Skip to content

Instantly share code, notes, and snippets.

@shawnritchie
Last active September 23, 2015 17:44
Show Gist options
  • Save shawnritchie/596c7715ac6bc7628c64 to your computer and use it in GitHub Desktop.
Save shawnritchie/596c7715ac6bc7628c64 to your computer and use it in GitHub Desktop.
Bowling
Rules:
------
- 10 Pins in total
- 10 Frames
- 1 Frame contains 2 rolls
- Open Frame - When not all pins have been knocked down during the 2 rolls in a frame
- Spare - All pins have been knocked down in both rolls for a frame
- Strike - All pins have been knocked down in a single roll for a grame
- Extra Roll - Extra Roll if you hit a spare during your last Frame
- Extra Frame - Extra Frame if you hit a strike during your last Frame
Scoring:
- Open Frames - Score: the number of pins knocked down (Max: 9)
- Spare - Score: 10 + the number of pins knocked down in the next roll
MAX: 20 -> current_frame(SPARE) + next_roll(STRIKE) (10 + 10)
MIN: 10 -> current_frame(SPARE) + next_roll(NONE) (10 + 0)
- Strike - Score: 10 + the number of pins knocked down in the next two rolls
MAX: 30 -> current_frame(SPARE) + next_roll(STRIKE) + next_roll(STRIKE) (10 + 10 + 10)
MIN: 10 -> current_frame(SPARE) + next_roll(NONE) + next_roll(NONE) (10 + 0 + 0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment