public class Game {
	private int score = 0;
	private int rolls[] = new int[21];
	private int currentRoll = 0;
	
	public void roll(int pins) {
		score += pins;
		rolls[currentRoll++]=pins;
	}

	public int score() {
		int score = 0;
		for(int i=0;i<rolls.length;i++){
			score += rolls[i];
		}
		return score;
	}
}
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 i = 0;
		for(int frame=0;frame<10;frame++){
			score += rolls[i] + rolls[i+1];
			i+=2;
		}
		return score;
	}
}
refactor bowling kata