stephane-genicot.github.io

Bowling

Alt text

About this Kata

This short and simple Kata should be performed using Test Driven Development (TDD).

This description is based on that at Adventures in C#: The Bowling Game

Create a program, which, given a valid sequence of rolls for one line of American Ten-Pin Bowling, produces the total score for the game. Here are some things that the program will not do:

Problem Description

We can briefly summarize the scoring for this form of bowling:

More info on the rules at : http://www.topendsports.com/sport/tenpin/scoring.htm

Clues

What makes this game interesting to score is the lookahead in the scoring for strike and spare. At the time we throw a strike or spare, we cannot calculate the frame score: we have to wait one or two frames to find out what the bonus is.

Suggested Test Cases

(When scoring “X” indicates a strike, “/” indicates a spare, “-” indicates a miss)

Comments from those who have mastered this Kata

Write some thoughts here about what you have learnt from this Kata. You don’t have to post all the code of your solution - I think the solution in itself is less interesting than the path you took to get there and what decisions you made. Just seeing the code won’t necessarily help me to reproduce it for myself. So in this section various people might go through the main parts of the problem and how they tackled them, what design ideas were discarded, and which order the test cases were implemented in.

The complete description can be found here : Coding Dojo

Clean Code - TDD : click here

IMPORTANT: Implement the requirements focusing on writing the best code you can produce.