Skip to content

Instantly share code, notes, and snippets.

@andreas
Forked from RSpace/bowling_scores.rb
Last active August 29, 2015 13:58
Show Gist options
  • Save andreas/9930618 to your computer and use it in GitHub Desktop.
Save andreas/9930618 to your computer and use it in GitHub Desktop.
# Start with these
[0, [0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0]]
[20, [1,1, 1,1, 1,1, 1,1, 1,1, 1,1, 1,1, 1,1, 1,1, 1,1]]
# Games with a spare
[29, [5,5, 1,1, 1,1, 1,1, 1,1, 1,1, 1,1, 1,1, 1,1, 1,1]]
[38, [5,5, 1,9, 1,1, 1,1, 1,1, 1,1, 1,1, 1,1, 1,1, 1,1]]
# Games with a strike
[30, [1,1, 10, 1,1, 1,1, 1,1, 1,1, 1,1, 1,1, 1,1, 1,1]]
[245, [10, 10, 10, 10, 10, 10, 10, 10, 10, 1,1]
# End game
[150, [5,5, 5,5, 5,5, 5,5, 5,5, 5,5, 5,5, 5,5, 5,5, 5,5, 5]]
[47, [1,1, 1,1, 1,1, 1,1, 1,1, 1,1, 1,1, 1,1, 1,1, 10, 10 ,9]]
[240, [10, 10, 10, 0,0, 10, 10, 10, 10, 10, 10, 10, 10]]
[173, [7,3, 7,3, 7,3, 7,3, 7,3, 7,3, 7,3, 7,3, 7,3, 7,3, 10]]
# Icing on the cake
[6, [1,1, 1,1, 1,1]] # incomplete
[18, [1,1, 6,4, 3]] # incomplete w/ spare
[280, [10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 5]] # incomplete
[300, [10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10]] # extras
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment