
public class Game {

	private int score;

	public void roll(int pins) {
		score+=pins;
		
	}

	public int score() {
		
		return score;
	}

}

@@ -1,9 +1,8 @@
-%0A
 public c
@@ -26,22 +26,68 @@
 vate int
- score
+%5B%5D rolls = new int%5B21%5D;%0A%09private int currentRoll = 0
 ;%0A%0A%09publ
@@ -117,23 +117,37 @@
 %7B%0A%09%09
-score+=
+rolls%5BcurrentRoll++%5D = 
 pins;%0A
-%09%09
 %0A%09%7D%0A
@@ -171,19 +171,409 @@
 e() %7B%0A%09%09
-%0A%09%09
+int score = 0;%0A%09    int frameIndex = 0;%0A%09    for (int frame = 0; frame %3C 10; frame++) %7B%0A%09      if (rolls%5BframeIndex%5D + %0A%09          rolls%5BframeIndex + 1%5D == 10) // spare%0A%09      %7B%0A%09        score += 10 + rolls%5BframeIndex + 2%5D;%0A%09        frameIndex += 2;%0A%09      %7D else %7B%0A%09        score += rolls%5BframeIndex%5D + %0A%09                 rolls%5BframeIndex + 1%5D;%0A%09        frameIndex += 2;%0A%09      %7D%0A%09    %7D%0A%09    
 return s

test 4 green