Commits

Christoph Schindler committed 3fa6bd6

pair 7

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

Comments (0)

Files changed (1)

BowlingWithAVengeance/bowling.py

 def get_score(frames):
     score = 0
     
-    for index,frame in enumerate(frames):
+    for index, frame in enumerate(frames):
         score += frame_score(frame)
-    if score == 18:
-        return 26
+        if index < len(frames) - 1:
+            # if this is not the last frame, we might want to
+            # look at future frames for additional scores
+            next_frame = frames[index+1]
+            if is_strike(frame):
+                score += frame_score(next_frame)
     return score