going in the wrong direction
This commit is contained in:
1 parent
26f824fd06
commit
28f44df3b9
1 file changed
+4
-2
+4
-2
@@ -17,7 +17,7 @@ class BowlingCase:
|
|||||||
return isinstance(self.first_throw, int) and isinstance(self.second_throw, int)
|
return isinstance(self.first_throw, int) and isinstance(self.second_throw, int)
|
||||||
|
|
||||||
def is_spare(self):
|
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):
|
def requires_extra_throw(self):
|
||||||
if self.is_spare():
|
if self.is_spare():
|
||||||
@@ -28,7 +28,9 @@ class BowlingCase:
|
|||||||
self.xtra_throw = throw
|
self.xtra_throw = throw
|
||||||
|
|
||||||
def score(self):
|
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:
|
class BowlingGame:
|
||||||
|
|||||||
Reference in new issue
Block a user