generated from mwc/lab_dice
Finished checkpoint 1
I could simulating a classroom reward system where students earn points for positive behaviors.
This commit is contained in:
@@ -19,6 +19,20 @@ class FiveDice:
|
|||||||
return False
|
return False
|
||||||
return True
|
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()
|
dice = FiveDice()
|
||||||
successes = 0
|
successes = 0
|
||||||
trials = 1000000
|
trials = 1000000
|
||||||
|
|||||||
Reference in New Issue
Block a user