Finished checkpoint 1

I could simulating a classroom reward system where students earn points for positive behaviors.
This commit is contained in:
tsmith37
2025-11-18 16:27:43 -05:00
parent 87fdbcc379
commit 4ff8ebc6a3
2 changed files with 15 additions and 0 deletions

View File

@@ -19,6 +19,20 @@ class FiveDice:
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
trials = 1000000

1
die.py
View File

@@ -15,3 +15,4 @@ class Die:
def roll(self):
self.face = randint(1, 6)
return self.face