Compute Bowling Scores

This program computes the score of a bowling game.

To quickly recap the rules, bowling is played in 10 frames. At the beginning of each frame, 10 pins are set up, and the bowler is given two rolls to knock them all down. The score for a frame is the total number of pins knocked down by the two rolls. However, if all the pins are knocked down by the first roll (known as a strike), the score for the frame is increased by the total number of pins knocked down by the next two rolls. If all the pins are knocked down by the first and second roll combined (known as a spare), the score for the frame is increased by the number of ...

Get Find the Bug A Book of Incorrect Programs now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.