Ask your own question, for FREE!
Computer Science 7 Online
OpenStudy (anonymous):

Can someone help me with python? here is my problem: -Yahtzee: all five dice show the same value - Four of a kind (but not Yahtzee): four dice showing the same value - Three of a kind (but not four of a kind, full house, or Yahtzee): three dice showing the same value - Full house (but not three of a kind): three of a kind and a pair - Large straight: five sequential dice - Small straight (but not large straight): four sequential dice - Miscellaneous: none of the above combinations I need the dice to roll randomly, and then determine if the numbers in the dice would satisfy one of the conditio

OpenStudy (anonymous):

5 dices for this one

OpenStudy (rsmith6559):

The random module is what you want. import random random.seed() For each die, each roll: random.randint( 1, 6 )

OpenStudy (anonymous):

Thanks! I got that down except for the full house dice where in 5 dices there's three dices which has the same value and another 2 dices which also has the same value. Can anyone help?

OpenStudy (anonymous):

How do you detect 3 of a kind and 2 of a kind? A full house is a 3 of a kind and a 2 of a kind, but for different numbers. If you determine the rank (the number that was rolled) of the 3 and 2 of a kind then you could see if they were different.

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!