|
|
@ -1,10 +1,17 @@ |
|
|
|
package de.edu.hsfulda.ciip.tdd; |
|
|
|
|
|
|
|
import java.util.regex.Matcher; |
|
|
|
import java.util.regex.Pattern; |
|
|
|
|
|
|
|
public class BownlingCalculator { |
|
|
|
|
|
|
|
public int evaluate(String listOfThrows) { |
|
|
|
// TODO Auto-generated method stub |
|
|
|
return 0; |
|
|
|
Matcher matcher = Pattern.compile("\\d").matcher(listOfThrows); |
|
|
|
int sum =0; |
|
|
|
while (matcher.find()) { |
|
|
|
sum+=Integer.parseInt(matcher.group()); |
|
|
|
} |
|
|
|
return sum; |
|
|
|
} |
|
|
|
|
|
|
|
} |