From 28f44df3b9b947070efe4fc8594230d6fec38abb Mon Sep 17 00:00:00 2001 From: didier amyot Date: Wed, 20 Dec 2023 14:48:46 -0500 Subject: [PATCH] going in the wrong direction --- tdd/bowling.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tdd/bowling.py b/tdd/bowling.py index 4b01d2a..60c645d 100644 --- a/tdd/bowling.py +++ b/tdd/bowling.py @@ -17,7 +17,7 @@ class BowlingCase: return isinstance(self.first_throw, int) and isinstance(self.second_throw, int) def is_spare(self): - return self.first_throw != 10 and self.score() == 10 + return self.first_throw != 10 and self.score() >= 10 def requires_extra_throw(self): if self.is_spare(): @@ -28,7 +28,9 @@ class BowlingCase: self.xtra_throw = throw def score(self): - return (self.first_throw or 0) + (self.second_throw or 0) + return ((self.first_throw or 0) + + (self.second_throw or 0) + + (self.xtra_throw or 0)) class BowlingGame: