Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dnd-character: add test for one-time ability init #1416

Merged
merged 2 commits into from
Dec 12, 2018
Merged

Conversation

cmccandless
Copy link
Contributor

I came across an implementation that simply randomized each property whenever it was called, something like:

class Character():
    def strength():
        return randint(3, 18)

These values should be calculated only once each. Checking one twice should verify that this is the case.

Copy link
Member

@rpottsoh rpottsoh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@sshine
Copy link
Contributor

sshine commented Dec 12, 2018

Interesting!

And good catch!

@sshine sshine merged commit 8ff844c into master Dec 12, 2018
@cmccandless cmccandless deleted the cmccandless-patch-1 branch December 12, 2018 15:03
sshine added a commit to exercism/haskell that referenced this pull request Dec 14, 2018
This exercise was created in exercism/problem-specifications#1397.

It is a basic exercise in random generators, so the idea I had for the
Haskell track was to practice making QuickCheck generators rather than
simply use the standard random generator.

For this reason, QuickCheck is added as a root dependency.

The 1.1.0 test case added in exercism/problem-specifications#1416 does
not apply to QuickCheck generators.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants