Clarifications on Bowling

I was confused by the instructions for Bowling, and propose the following diffs.

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

:point_up_2: A consistency nitpick.

 - A strike is where all ten pins are knocked down by the first throw.
   The total value of a strike is 10 plus the number of pins knocked down in the next two throws.
-  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.

:point_up_2: This sentence does not deliver new information, i.e. explains nothing that has not already been explained, but does carry potential for confusion. (Reading it I wondered whether I was misunderstanding something, because the apparent meaning was too obvious.)

  The tenth frame in the game is a special case.
- If someone throws a strike or a spare then they get a fill ball.
+ If someone throws a spare or a strike then they get one or two fill balls respectively.
  Fill balls exist to calculate the total of the 10th frame.

:point_up_2: This sentence led me to Wikipedia for a sanity check. I didn’t know the rules of bowling beforehand; my confusion stemmed purely from this inconsistency in the instructions. As it turns out, the number of fill balls depends on the last frame result, so let’s say that.

(:thinking: How many fill balls are thrown when the 9th frame is a strike? Ah, the above still holds true, it all works out, no special rules required here :grin:)

  Scoring a strike or spare on the fill ball does not give the player more fill balls.
  The total value of the 10th frame is the total number of pins knocked down.

:point_up_2: While these sentences do not actually add information either, I’m fine with keeping them as the capacity for confusion seems very low.


Also a canonical datum confuses me. Edit: no longer!

consecutive spares each get a one roll bonus
5 5  3 7  4 0  0 0  0 0  0 0  0 0  0 0  0 0  0 0 ↦ 31

Should this not sum to (10 + 3) + (10 + 4) = 27 instead?

1 Like

This exercise is certainly one of the more confusing ones. Here’s a preemptive approval :smile:

The scores for the first three frames are (10 + 3), (10 + 4), (4). That combines to give 31. Maybe amend that line to show the per-frame scores?

5 5 3 7 4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ↦ 10 + 3, 10 + 4, 4, 0, … ↦ 31

Of course! :persevere:

Now it totally makes sense that this was ‘overlooked’ for so many years.

There is no line about this; I just pretty-printed the canonical data entry. Had I not read the tests I wouldn’t have been confused on this point.

2 Likes

The most important suggestion above has already been merged; the rest is now part of Bowling: minor correction & a clarification through omission by MatthijsBlom · Pull Request #2236 · exercism/problem-specifications · GitHub.