Bowling game kata for ONS software development practices training
This repository forms part of the ONS Software Development Practices
engineering training sessions. It contains a base project to run the bowling
game kata from.
master
an empty project which can be used to practice/demonstrate the katacompleted
a branch with the completed code and a commit history detailingThe bowling game kata is a well know code kata. The aim is to use TDD to
implement a class which calculates the score of a 10 pin bowling game. The class
should have the following interface:
class BowlingGame:
def roll(self, pins):
"""
Call this each time a ball is rolled passing in the number of pins that
were knocked down.
"""
def score(self):
"""
Call this at the end of the game to get the final score.
"""
10
frames2
rolls per frame to try and knock down all 10
pins10
pins in a frame then they score a spare
:spare
is the 10
pins plus the next roll as a bonus10
pins in the first roll of a frame then theystrike
:strike
is scored then there is no second roll in the framestrike
is the 10
pins plus the next 2
rolls as a bonusstrike
is scored in the last frame then 2
bonus rolls are added to12
successive strikes
and scores 300
pointsFor a real implementation of this you would want to check for errors, including
the following:
roll
10
pins passed to roll
However, for this demonstration we are only focussing on the happy path.