Reformat of src

This commit is contained in:
2015-04-27 14:52:31 +02:00
parent 28f74050b0
commit e6cb8c4135

View File

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