This is a dice game translated to a webpage. Roll a dice and you get that many points. Roll as many times as you'd like and add the points up. If you roll a 1 you lose all your points from that turn and give the dice to the next player. At any point before rolling a 1 you may choose to hold, add the points to your total and give the dice to the next player. 1st to 100 points wins
The middle of the game has been omitted for the sake of brevity. Player 1s score does not actually go from 0 to 93!

Software Requirements
- Internet browser
- A code editor like VSCode or Atom to view or edit the codebase.
Open by downloading:
- Download this repository onto your computer by clicking the 'clone or download button'
- Double click index.html to open it in your web browser
Open via Bash/GitBash:
- Clone this repository onto your computer:
git clone https://github.com/LINDGRENBA/pig-dice.git - Navigate into the
/pig-dice/directory in Visual Studio Code or preferred text editorcode . - Open index.html in Chrome or preferred browser:
open index.html
| Behavior | Input | Output |
|---|---|---|
| The Program allows user1 to roll a dice numbered 1 through 6 | Click "roll dice" | 4 |
| The Program allows user2 to roll a dice numbered 1 through 6 | Click "roll dice" | 3 |
| The Program will create a Total score and turn score for each user. Each will begin at 0 | no input | user1 total Score = 0, Turn Score = 0 & user2 Total Score = 0, Turn Score = 0 |
| If user rolls a 1, turn score resets to 0 and turn changes to next user | 1 | Turn Score = 0 |
| If user holds, add turn score to total score for that user and turn changes to next user | click "hold" | turn score + total score |
| If user1 or user2 total score is >= 100, game over, user with high score wins | user1 total score = 103 | "User 1 Wins!!!", game ends - show option to play new game |
No known bugs
Please reach out through my GitHub account.
- HTML
- CSS
- JavaScript
- VSCode
MIT License.
Copyright (c) 2020 Jason Khan and Brittany Lindgren