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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.