dustinbarnes / bowling-test

A simple skeleton for implementing a bowling scoring algorithm. One of my favorite pairing-interview questions.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

bowling-test

A simple skeleton for implementing a bowling scoring algorithm.

One of my favorite pairing-interview questions.

If you are unfamiliar with the rules of scoring bowling, they are as follows:

  • The game has ten frames. The object in each frame is to knock down the ten pins.
  • Each frame has two throws
  • The user's basic score for a frame is the total of two throws.
  • If the user knocks down all ten pins on the first throw of a frame that is a strike. The score for that frame includes the strike, plus the score for the next two throws.
  • If the user knocks down all ten pins with both shots in the frame, that is a spare. The score for that frame includes the ten points for the spare, plus the pins knocked down in the next throw.
  • If the user gets a strike in the tenth frame, the user takes two additional shots to get added to the score. If the user gets a spare in the tenth frame, the user gets one additional shot to be added to the score.
  • By the above rules, a perfect game has a score of 300.

About

A simple skeleton for implementing a bowling scoring algorithm. One of my favorite pairing-interview questions.

License:MIT License


Languages

Language:Java 100.0%