Commits

Christoph Schindler committed bb555a9

pair 4

  • Participants
  • Parent commits e3a5c14
  • Branches dojo-2012-10-21

Comments (0)

Files changed (2)

BowlingWithAVengeance/bowling.py

     return frame_score(frame) == 10 and not is_strike(frame)
     
 def get_score(frames):
-    score = 0
     score = sum(frame_score(frame) for frame in frames[:10])
     for index, frame in enumerate(frames):
         if index < len(frames) - 1 and index < 10:

BowlingWithAVengeance/test.py

     assert_equal(bowling.get_score(((1, 9), (3, 4))), 20)
     
 def test_perfect_game():
-    assert_equal(bowling.get_score([(10,)] * 12), 300)    
+    assert_equal(bowling.get_score([(10,)] * 12), 300) 
+    
+def test_only_nines():
+    assert_equal(bowling.get_score([(9,0)] * 10), 90)
+        
+def test_game_with_spares():
+    assert_equal(bowling.get_score([(5,5)] * 10 + [(5,)]), 150)