Skip to content

Commit b8f8f54

Browse files
authored
Sync docs for practice exercise bowling (exercism#2381)
1 parent 195e962 commit b8f8f54

1 file changed

Lines changed: 26 additions & 31 deletions

File tree

exercises/practice/bowling/.docs/instructions.md

Lines changed: 26 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -2,35 +2,30 @@
22

33
Score a bowling game.
44

5-
Bowling is a game where players roll a heavy ball to knock down pins
6-
arranged in a triangle. Write code to keep track of the score
7-
of a game of bowling.
5+
Bowling is a game where players roll a heavy ball to knock down pins arranged in a triangle.
6+
Write code to keep track of the score of a game of bowling.
87

98
## Scoring Bowling
109

11-
The game consists of 10 frames. A frame is composed of one or two ball
12-
throws with 10 pins standing at frame initialization. There are three
13-
cases for the tabulation of a frame.
10+
The game consists of 10 frames.
11+
A frame is composed of one or two ball throws with 10 pins standing at frame initialization.
12+
There are three cases for the tabulation of a frame.
1413

15-
* An open frame is where a score of less than 10 is recorded for the
16-
frame. In this case the score for the frame is the number of pins
17-
knocked down.
14+
- An open frame is where a score of less than 10 is recorded for the frame.
15+
In this case the score for the frame is the number of pins knocked down.
1816

19-
* A spare is where all ten pins are knocked down by the second
20-
throw. The total value of a spare is 10 plus the number of pins
21-
knocked down in their next throw.
17+
- A spare is where all ten pins are knocked down by the second throw.
18+
The total value of a spare is 10 plus the number of pins knocked down in their next throw.
2219

23-
* A strike is where all ten pins are knocked down by the first
24-
throw. The total value of a strike is 10 plus the number of pins
25-
knocked down in the next two throws. If a strike is immediately
26-
followed by a second strike, then the value of the first strike
27-
cannot be determined until the ball is thrown one more time.
20+
- A strike is where all ten pins are knocked down by the first throw.
21+
The total value of a strike is 10 plus the number of pins knocked down in the next two throws.
22+
If a strike is immediately followed by a second strike, then the value of the first strike cannot be determined until the ball is thrown one more time.
2823

2924
Here is a three frame example:
3025

31-
| Frame 1 | Frame 2 | Frame 3 |
32-
| :-------------: |:-------------:| :---------------------:|
33-
| X (strike) | 5/ (spare) | 9 0 (open frame) |
26+
| Frame 1 | Frame 2 | Frame 3 |
27+
| :--------: | :--------: | :--------------: |
28+
| X (strike) | 5/ (spare) | 9 0 (open frame) |
3429

3530
Frame 1 is (10 + 5 + 5) = 20
3631

@@ -40,22 +35,22 @@ Frame 3 is (9 + 0) = 9
4035

4136
This means the current running total is 48.
4237

43-
The tenth frame in the game is a special case. If someone throws a
44-
strike or a spare then they get a fill ball. Fill balls exist to
45-
calculate the total of the 10th frame. Scoring a strike or spare on
46-
the fill ball does not give the player more fill balls. The total
47-
value of the 10th frame is the total number of pins knocked down.
38+
The tenth frame in the game is a special case.
39+
If someone throws a spare or a strike then they get one or two fill balls respectively.
40+
Fill balls exist to calculate the total of the 10th frame.
41+
Scoring a strike or spare on the fill ball does not give the player more fill balls.
42+
The total value of the 10th frame is the total number of pins knocked down.
4843

4944
For a tenth frame of X1/ (strike and a spare), the total value is 20.
5045

5146
For a tenth frame of XXX (three strikes), the total value is 30.
5247

5348
## Requirements
5449

55-
Write code to keep track of the score of a game of bowling. It should
56-
support two operations:
50+
Write code to keep track of the score of a game of bowling.
51+
It should support two operations:
5752

58-
* `roll(pins : int)` is called each time the player rolls a ball. The
59-
argument is the number of pins knocked down.
60-
* `score() : int` is called only at the very end of the game. It
61-
returns the total score for that game.
53+
- `roll(pins : int)` is called each time the player rolls a ball.
54+
The argument is the number of pins knocked down.
55+
- `score() : int` is called only at the very end of the game.
56+
It returns the total score for that game.

0 commit comments

Comments
 (0)