Skip to content

Commit

Permalink
add example of usage/make clearer UI is optional
Browse files Browse the repository at this point in the history
  • Loading branch information
Samir70 committed Feb 24, 2023
1 parent 7edee77 commit 1ee1b22
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,33 @@ Bowling Challenge

## The Task

**THIS IS NOT A BOWLING GAME, IT IS A BOWLING SCORECARD. DO NOT GENERATE RANDOM ROLLS. THE USER INPUTS THE ROLLS.**
**THIS IS NOT A BOWLING GAME, IT IS A BOWLING SCORECARD. DO NOT GENERATE RANDOM ROLLS. AN ACTUAL USER INTERFACE IS OPTIONAL**

Count and sum the scores of a bowling game for one player (in JavaScript).
Count and sum the scores of a bowling game for one player (in JavaScript).

A bowling game consists of 10 frames in which the player tries to knock down the 10 pins. In every frame the player can roll one or two times. The actual number depends on strikes and spares. The score of a frame is the number of knocked down pins plus bonuses for strikes and spares. After every frame the 10 pins are reset.

Start by looking in detail at the scoring in the examples below.

An example of how your code might be used could be:

```javaScript
let scorecard = new Scorecard()
scorecard.addRoll(5)
scorecard.calculateScore() // returns 5
scorecard.addFrame([3, 5]) // returns "Please finish the current frame [5, ?]"
scorecard.addRoll(2)
scorecard.addFrame([3, 5])
scorecard.calculateScore() // returns 15
scorecard.showScore() // [[5, 2], [3, 5]]
```

As usual please start by

* Forking this repo

* Using test-driven development (if you decide to write a user interface, then make sure you have looked at the chapters on mocking).

* Finally submit a pull request before Monday week at 9am with your solution or partial solution. However much or little amount of code you wrote please please please submit a pull request before Monday week at 9am.

___STRONG HINT, IGNORE AT YOUR PERIL:___ Bowling is a deceptively complex game. Careful thought and thorough diagramming — both before and throughout — will save you literal hours of your life.
Expand Down

0 comments on commit 1ee1b22

Please sign in to comment.