소스 검색

Update BowlingGame.java

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
                 }
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
+}