New Page 1

Modeling Assignment

You are asked to write an application that maintains the score of a single game in bowling. I apologize if you have never bowled before.

Game Play (from wikipedia entry)

A game of ten-pin bowling is divided into ten rounds (called "frames"). In a frame, each player is given two opportunities to knock down the skittle targets (called "pins"). He or she rolls the first ball at the pins. If the first ball knocks down all ten pins, it is called a "strike" and the frame is completed. When pins are left standing after the first ball, those that are knocked down are counted and then removed. Then the player rolls a second ball and if all the remaining pins are knocked down, it is called a "spare". There are bonuses for removing all the pins. The final or tenth frame of a game may involve three balls.

Scoring

In general, one point is scored for each pin that is knocked over. So if a player bowls over three pins with the first shot, then six with the second, the player would receive a total of nine points for that frame. If a player knocks down 9 pins with the first shot, but misses with the second, the player would also score nine. When a player fails to knock down all ten pins after their second ball it is known as an open frame.

In the event that all ten pins are knocked over by a player in a single frame, bonuses are awarded.

Frame 1, ball 1: 10 pins (strike)
Frame 2, ball 1: 3 pins
Frame 2, ball 2: 6 pins
The total score from these throws is:
  • Frame one: 10 + (3 + 6) = 19
  • Frame two: 3 + 6 = 9
TOTAL = 28
 
A player who scores multiple strikes in succession would score like so:
Frame 1, ball 1: 10 pins (strike)
Frame 2, ball 1: 10 pins (strike)
Frame 3, ball 1: 4 pins
Frame 3, ball 2: 2 pins
The score from these throws is:
  • Frame one: 10 + (10 + 4) = 24
  • Frame two: 10 + (4 + 2) = 16
  • Frame three: 4 + 2 = 6
TOTAL = 46
The most points that can be scored in a single frame is 30 points (10 for the original strike, plus strikes in the two subsequent frames).
Example:
Frame 1, ball 1: 7 pins
Frame 1, ball 2: 3 pins (spare)
Frame 2, ball 1: 4 pins
Frame 2, ball 2: 2 pins

A player who bowls a spare in the tenth (final) frame is awarded one extra ball to allow for the bonus points.

Sample bowling


 

In the above game, the order of the throws is as follows:

1,4,4,5,6,4,5,5,10,0,1,7,3,6,4,10,2,8,6

And the score at the end would be rated as 133.

Interested in Scoring?

See http://www.balmoralsoftware.com/bowling/bowling.htm for some truly interesting analyses of bowling from a Computer Science perspective.