Skip to content

Instantly share code, notes, and snippets.

@manuelmeurer
Created March 29, 2016 19:10
Show Gist options
  • Save manuelmeurer/8381ecad51080718e1a4712e90e8711e to your computer and use it in GitHub Desktop.
Save manuelmeurer/8381ecad51080718e1a4712e90e8711e to your computer and use it in GitHub Desktop.
Bowling Code Challenge

Bowling Code Challenge

  • Please create a repository in GitHub (or a similar service) so that we can follow your progress.
  • The implementation should use "vanilla" JavaScript (no libraries or frameworks).
  • Remember that we are more interested how you approach this problem than seeing you complete all the features (if you don't have enough time to finish everything, simply explain how you would continue the implementation).

Minimum requirements

  • Implement a scoring system for a bowling game according to these rules:
  • A game consists of 10 frames.
  • In general each frame has 2 rolls.
  • In general a player scores the number of pins knocked down.
  • If the player knocks down all 10 pins on the first roll, it’s a strike. The player scores 10 plus the number of pins knocked down in the next two rolls.
  • If the player needs two rolls to knock down all 10 pins, it’s a spare. The player scores 10 plus the number of pins knocked down in the next roll.
  • Visualize the game in a simple way.

Optional requirements

  • Add support for the last frame in the game:
  • The player gets additional rolls in the last frame: one additional roll for a spare or two additional rolls for a strike.
  • Create a method that randomly throws a roll (one roll is 1-10 pins knocked down), and progresses the scoring.
  • Support multiple players.
  • Or any other fun feature you can think of. :)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment