generated from mwc/lab_dice
Check point 1
since we are doing this with dice, I think we could also use it to simulate a deck of cards which could be useful for a game.
This commit is contained in:
parent
f4bd21adaa
commit
42f81863d7
|
@ -18,6 +18,19 @@ class FiveDice:
|
|||
if face != 1:
|
||||
return False
|
||||
return True
|
||||
|
||||
def is_three_of_a_kind(self):
|
||||
for face in self.faces():
|
||||
if self.faces().count(face) >= 3:
|
||||
return True
|
||||
return False
|
||||
|
||||
def is_four_of_a_kind(self):
|
||||
for face in self.faces():
|
||||
if self.faces().count(face) >= 4:
|
||||
return True
|
||||
return False
|
||||
|
||||
|
||||
dice = FiveDice()
|
||||
successes = 0
|
||||
|
|
Loading…
Reference in New Issue