Explorar el Código

Update BowlingGame.java

TimoleonLatinopoulos hace 8 años
padre
commit
246bf3e14a
Ninguna cuenta está vinculada al correo electrónico del colaborador
Se han modificado 1 ficheros con 6 adiciones y 2 borrados
  1. 6
    2
      exercises/bowling/.meta/src/reference/java/BowlingGame.java

+ 6
- 2
exercises/bowling/.meta/src/reference/java/BowlingGame.java Ver fichero

25
                 }
25
                 }
26
 
26
 
27
                 int strikeBonus = strikeBonus(frameIndex);
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
                     throw new IllegalStateException("Pin count exceeds pins on the lane");
33
                     throw new IllegalStateException("Pin count exceeds pins on the lane");
30
                 }
34
                 }
31
 
35
 
81
     private int frameScore(int frameIndex) {
85
     private int frameScore(int frameIndex) {
82
         return rolls.get(frameIndex) + rolls.get(frameIndex + 1);
86
         return rolls.get(frameIndex) + rolls.get(frameIndex + 1);
83
     }
87
     }
84
-}
88
+}