From 773aebc443d9c64524dc4118095920474138eee7 Mon Sep 17 00:00:00 2001 From: caglazir Date: Sun, 16 Nov 2025 20:37:25 -0500 Subject: [PATCH] I edited the dice code to include 3 & 4 of a kind. Checkpoint 1: I am not familiar with classes at all so I am still a little unsure of what I could implement this on. Maybe for things that need to run multiple times until it corresponds to a certain value... The first thing I can think of is hacking! Like in the movies the hackers run bunch of passwords until they find the right one, lol! Since we're also in the game unit, I remember there was these dressing up games that would score your outfit for certain events. I wonder if they utilized a similar thing where they went through various combinations that the players made and scored if they were matching (like three of a kind, etc.). --- dice_stats.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/dice_stats.py b/dice_stats.py index 83a99cb..a213bd8 100644 --- a/dice_stats.py +++ b/dice_stats.py @@ -18,6 +18,20 @@ 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