Closed brentleyjones closed 9 years ago
adding two discrete variables is more like xor
I think? Multiply is like P(both of these happen) so I think and
is appropriate. I don't know if we want a more descriptive function name. Let me get back to you after coffee.
They aren't exactly xor
or or
, so or
fits better when thinking of saying the following: "I can get heads or tails" or "I can get 1 or 2 or 3 or 4 or 5 or 6". It's a way to build it up. Similar is "I can get (heads or tails) and (heads or tails) and (heads or tails)".
I see how it is actually xor
. I'll think on that one. I think xor
makes sense for probability, but most people think of it as "or" verbally. So the inner one can be xor
while the outer operator can still be be ||
maybe?
Ignore all of the above, I renamed it to xor
and made a logical xor operator ^^
.
@TabletopAssistant/dicekit This is ready for code review. I'll do the documentation and playground in the next day or two (and I'll ping everyone again then).
I think the names for the methods are fine. I only pointed out code style things. Other than that, :+1:
Also, README and Playground. Just noticed that they are still on your list.
Finally got around to updating the playground. It made me implement some protocols to make it easier to use. I love playgrounds.
@LoganJohnson @JonathanHoffman Ready for final review :tada:
I realized that I need to add tests for the new SequenceType
/CollectionType
conformance I have/am adding.
Wow, I've never seen a frequency distribution like that! Very nice!
Ready for final code review. All tests in. Playground up and running. :dash:
:+1: Super pumped to see this stuff in action. That probability graph in the playground is the bees knees.
I'll fix the typo soon, then merge if no other comments come up.
Closes #58.
I'm not doing the equality tests as part of this. I want to refactor those so they are very easy to test for anything that implements
Equatable
(#54).