The standard output will contain, on successful completion of the program, two output lines for each input line. The first output line contains the name of the bowler and a record of the throws in each frame. This record shows, for each frame, the number of pins knocked down for each throw as a digit, with some exceptions. For a throw that knocks down no pins, a dash (\verb$-$) is used instead of a `0'. An 'X' indicates a throw that knocks down all 10 pins on the first try. A slash ('/') indicates a throw that finishes knocking down all the pins, after the previous throw left some standing. Otherwise, a throw is shown as a digit (`1' to `9'). The number of throws in a frame may be one (a strike in frames 1 to 9), or three (a strike or spare in frame 10, followed by bonus balls), but is usually two. Here are examples of throw markings for a variety of situations:
Marking | Comment |
81 |
Knocked down 8 balls on the first throw, one on the next |
7/ | Knocked down 7 balls on the first throw, then the rest |
X | Knocked down all balls on the first throw |
9- | Knocked down 9 balls on the first throw, none on the next |
8/X | Knocked down 8 balls on the first throw of frame 10, then the rest,then all the pins on the bonus throw |
X-/ | Knocked down ten balls on the first throw of frame 10, then missed all the pins on the first bonus throw and knocked them all down on thesecond bonus throw |
The second output line shows cumulative scores. The cumulative score for the first frame is just the score for pins knocked down in frame, plus bonus points if they apply. The cumulative score for any other frame is the cumulative score for the previous frame plus the score for pins knocked down in that frame, plus the bonus pins that may have been earned for a strike or spare in this frame. It is possible to have markings on line one for a frame, but no score on line two, in the event that the frame is a strike or spare but the bonus points for the frame aren't yet known.
The format for this output requires that the bowler's name be left-justified. The fields for each frame are three characters wide, with a space separating each field. The fields begin in columns 14, 18, 22, and so on. The record of the throws in the first line is left justified in its field. The cumulative score is right justified in its field. There is a blank line that separates the scores of one bowler from the scores of another.