Browse Source

quick and dirty implementation, mostly by copy&paste

master
Thomas Papendieck 6 years ago
parent
commit
f96ff59979
  1. 4
      TDD-pure-function/src/main/java/de/edu/hsfulda/ciip/tdd/BownlingCalculator.java

4
TDD-pure-function/src/main/java/de/edu/hsfulda/ciip/tdd/BownlingCalculator.java

@ -11,6 +11,10 @@ public class BownlingCalculator {
while (singleDigit.find()) { while (singleDigit.find()) {
sum += Integer.parseInt(singleDigit.group()); sum += Integer.parseInt(singleDigit.group());
} }
singleDigit = Pattern.compile("(\\d)/ (\\d)").matcher(listOfThrows);
while (singleDigit.find()) {
sum += 10 - Integer.parseInt(singleDigit.group(1)) + Integer.parseInt(singleDigit.group(2));
}
return sum; return sum;
} }

Loading…
Cancel
Save