This is a Ruby adaptation of Uncle Bob's Bowling Kata in Java, which can be found here. The following test cases will be covered:
- A game with 20 rolls of 0 must have a score of 0.
- A game with 10 rolls of 0 & 10 rolls of 1 must have a score of 10.
- A game with the rolls 5, 5, 3, and 17 rolls of 0 must have a score of 16 (The two 5's are a spare.)
- A game with the rolls 10, 3, 4, and 16 rolls of 0 must have a score of 24 (The 10 is a strike.)
- A game with 12 rolls of 10 must have a score of 300
You do not need to know them to complete this Kata, but if you want to know the rules in detail, this is a good resource. It is very handy to know some basics:
- For the most part, you keep score by adding the number of pins knocked down in each frame.
- Special bonuses are awarded for strikes and spares.
- When a strike is bowled, the bowler is awarded the score of 10 (for knocking down all ten pins), plus they get to add the total of their next two rolls to that frame.
- For a spare, the bowler gets the 10, plus the total number of pins knocked down on the next roll only.
A kata is meant to be memorized. Students of a kata study it as a form, not as a conclusion. It is not the conclusion of the kata that matters, it's the steps that lead to the conclusion. If you want to lean to think the way I think, to design the way I design, then you must learn to react to minutia the way I react. Following this form will help you to do that. As you learn the form, and repeat it, and repeat it, you will condition your mind and body to respond the way I respond to the minute factors that lead to design decisions. - Uncle Bob

































