From 5c4aabf824d7b2763655faa1269a9ff12fa7b41f Mon Sep 17 00:00:00 2001 From: Thomas Papendieck Date: Wed, 28 Nov 2018 18:15:10 +0100 Subject: [PATCH] quick and dirty implementation, mostly by copy&paste --- .../main/java/de/edu/hsfulda/ciip/tdd/BownlingCalculator.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/TDD-pure-function/src/main/java/de/edu/hsfulda/ciip/tdd/BownlingCalculator.java b/TDD-pure-function/src/main/java/de/edu/hsfulda/ciip/tdd/BownlingCalculator.java index 81f4955..39f132a 100644 --- a/TDD-pure-function/src/main/java/de/edu/hsfulda/ciip/tdd/BownlingCalculator.java +++ b/TDD-pure-function/src/main/java/de/edu/hsfulda/ciip/tdd/BownlingCalculator.java @@ -22,6 +22,9 @@ public class BownlingCalculator { sum += evaluateFrames(listOfThrows, SPARE, m -> PINS_IN_FRAME// - Integer.parseInt(m.group(SPARE_FRAME_FIRST_THROW)) + Integer.parseInt(m.group(SPARE_FRAME_FOLLOWING_THROW))); + sum += evaluateFrames(listOfThrows, "X (\\d)(\\d)", m -> PINS_IN_FRAME// + + Integer.parseInt(m.group(1)) + + Integer.parseInt(m.group(2))); return sum; }