Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/thedivic/bowling-kata
Bowling Game Kata by Uncle Bob C. Martin
https://github.com/thedivic/bowling-kata
javascript kata nodejs
Last synced: 11 days ago
JSON representation
Bowling Game Kata by Uncle Bob C. Martin
- Host: GitHub
- URL: https://github.com/thedivic/bowling-kata
- Owner: TheDivic
- Created: 2019-02-21T14:11:20.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2023-01-03T16:35:00.000Z (about 2 years ago)
- Last Synced: 2024-11-12T14:07:39.760Z (2 months ago)
- Topics: javascript, kata, nodejs
- Language: JavaScript
- Size: 331 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 15
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Bowling Game Kata
A game of bowling consists of 10 rounds called **frames**.
In each frame the player has two opportunities to knock down 10 pins.
The score for the frame is the total number of pins knocked down, plus bonuses for strikes and spares.### Spare
A **spare** is when the player knocks down all 10 pins in two tries. The bonus for that frame is the number of pins knocked down by the next roll.
### Strike
A **strike** is when the player knocks down all 10 pins on his first try. The bonus for that frame is the value of the next two balls rolled.
### Endgame
In the tenth frame a player who rolls a spare or strike is allowed to roll the extra balls to complete the frame. However no more than three balls can be rolled in the tenth frame.
## Kata Requirements
Write a class named `Game` that has two methods:
- `roll(pins: int)` is called each time the player rolls a ball. The argument is the number of pins knocked down.
- `score() : int` is called only at the very end of the game. It returns the total score for that game.## References
- [TheBowlingGameKata](http://butunclebob.com/ArticleS.UncleBob.TheBowlingGameKata)