public class Game {

	private int[] rolls = new int[21];
	private int currentRoll = 0;

	public void roll(int pins) {
		rolls[currentRoll++] = pins;

	}

	public int score() {
		int score = 0;
	    int frameIndex = 0;
	    for (int frame = 0; frame < 10; frame++) {
	      if (isSpare(frameIndex)) // spare
	      {
	        score += 10 + rolls[frameIndex + 2];
	        frameIndex += 2;
	      } else {
	        score += rolls[frameIndex] + 
	                 rolls[frameIndex + 1];
	        frameIndex += 2;
	      }
	    }
	    return score;
	}

	private boolean isSpare(int frameIndex) {
		return rolls[frameIndex] + 
	          rolls[frameIndex + 1] == 10;
	}

}

@@ -270,16 +270,210 @@
     if (
+rolls%5BframeIndex%5D == 10) // strike%0A%09      %7B%0A%09        score += 10 +%0A%09                 rolls%5BframeIndex+1%5D +%0A%09                 rolls%5BframeIndex+2%5D;%0A%09        frameIndex++;%0A%09      %7D%0A%09      else if (
 isSpare(
@@ -488,17 +488,8 @@
 ex))
- // spare
 %0A%09  
@@ -582,16 +582,16 @@
  else %7B%0A
+
 %09       
@@ -611,33 +611,32 @@
 ls%5BframeIndex%5D +
- 
 %0A%09              

test 5 green