Browse Source

add implementation for the incomplete frames test

master
binsky 3 years ago
parent
commit
476b33a210
  1. 10
      src/main/java/BowlingGameCalculator.java
  2. BIN
      target/classes/BowlingGameCalculator.class
  3. BIN
      target/test-classes/BowlingCalculatorTest.class

10
src/main/java/BowlingGameCalculator.java

@ -1,5 +1,13 @@
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class BowlingGameCalculator {
public int score(String playerResult) {
return 0;
Matcher singleDigit = Pattern.compile("\\d").matcher(playerResult);
int playerScore = 0;
while (singleDigit.find()) {
playerScore += Integer.parseInt(singleDigit.group());
}
return playerScore;
}
}

BIN
target/classes/BowlingGameCalculator.class

BIN
target/test-classes/BowlingCalculatorTest.class

Loading…
Cancel
Save