TimoleonLatinopoulos 8 лет назад
Родитель
Сommit
246bf3e14a
Аккаунт пользователя с таким 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
+}