/**
 * A short program to run a game of bowling
 * 
 * @author Mike Zrimsek
 *
 */
public class Game {
	private int[] rollValues = new int[21];
	private int rollCounter = 0;

	/**
	 * Execute one roll
	 * 
	 * @param numPins
	 *            Numbers of pins hit
	 */
	public void roll(int numPins) {
		rollValues[rollCounter++] = numPins;
	}

	/**
	 * Calculate total score of game based on values for each roll
	 * 
	 * @return Total score for game
	 */
	public int score() {
		int score = 0; // tracks score
		int rollIndex = 0; // track which roll currently on
		for (int frame = 0; frame < 10; frame++) {
			// check if rolled a strike
			// 10 + value of next 2 balls rolled
			if (rollValues[rollIndex] == 10) {
				score += 10 + rollValues[rollIndex + 1]
						+ rollValues[rollIndex + 2];
				rollIndex++;
			}
			// check if rolled a spare
			// 10 + value of next ball rolled
			else if (rollValues[rollIndex] + rollValues[rollIndex + 1] == 10) {
				score += 10 + rollValues[rollIndex + 2];
				rollIndex += 2;
			} else {
				score += rollValues[rollIndex] + rollValues[rollIndex + 1];
				rollIndex += 2;
			}
		}
		return score;
	}
}

@@ -43,18 +43,17 @@
 wling%0A *
- 
 %0A
+
  * @auth
@@ -192,25 +192,24 @@
 one roll%0A%09 *
- 
 %0A%09 * @param 
@@ -250,16 +250,42 @@
 pins hit
+, must be between 0 and 10
 %0A%09 */%0A%09p
@@ -427,20 +427,19 @@
 ch roll%0A
+
 %09 *
- 
 %0A%09 * @re

Update documentation on valid pin number