This commit is contained in:
2015-04-23 11:36:11 +02:00
parent 676c842435
commit 951ba3b8ad

View File

@@ -11,9 +11,11 @@ public class BowlingScoreCalculator {
char roll = rolls.charAt(rollIndex);
if (rollIsStrike(roll)) {
handleStrike(rolls, rollIndex);
} else if (rollIsSpare(roll)) {
}
else if (rollIsSpare(roll)) {
handleSpare(rolls, rollIndex);
} else {
}
else {
handleRegularRoll(rolls, rollIndex);
}
}
@@ -24,7 +26,8 @@ public class BowlingScoreCalculator {
sum += getValueForRolls(rolls, i);
if (firstRoll == true) {
firstRoll = false;
} else {
}
else {
countFrames++;
firstRoll = true;
}
@@ -62,9 +65,11 @@ public class BowlingScoreCalculator {
char roll = rolls.charAt(rollIndex);
if (rollIsStrike(roll)) {
return 10;
} else if (roll == '-') {
}
else if (roll == '-') {
return 0;
} else {
}
else {
return Integer.parseInt(roll + "");
}
}