TimoleonLatinopoulos пре 8 година
родитељ
комит
246bf3e14a
No account linked to committer's email
1 измењених фајлова са 6 додато и 2 уклоњено
  1. 6
    2
      exercises/bowling/.meta/src/reference/java/BowlingGame.java

+ 6
- 2
exercises/bowling/.meta/src/reference/java/BowlingGame.java Прегледај датотеку

@@ -25,7 +25,11 @@ class BowlingGame {
25 25
                 }
26 26
 
27 27
                 int strikeBonus = strikeBonus(frameIndex);
28
-                if (strikeBonus > MAXIMUM_FRAME_SCORE && !isStrike(frameIndex + 1) && spareBonus(frameIndex) > 10) {
28
+                if (strikeBonus > MAXIMUM_FRAME_SCORE && !isStrike(frameIndex + 1)) {
29
+                    throw new IllegalStateException("Pin count exceeds pins on the lane");
30
+                }
31
+                
32
+                if(spareBonus(frameIndex) > 10){
29 33
                     throw new IllegalStateException("Pin count exceeds pins on the lane");
30 34
                 }
31 35
 
@@ -81,4 +85,4 @@ class BowlingGame {
81 85
     private int frameScore(int frameIndex) {
82 86
         return rolls.get(frameIndex) + rolls.get(frameIndex + 1);
83 87
     }
84
-}
88
+}