https://github.com/aadewunmi/pig_game
This is a JavaScript implementation of the Pig Game (https://en.wikipedia.org/wiki/Pig_(dice_game). A simple dice game for 2 players (split screen). Starter code forked from Jonas Schmedtmann.
https://github.com/aadewunmi/pig_game
css3 html5 javascript pig-game
Last synced: about 1 month ago
JSON representation
This is a JavaScript implementation of the Pig Game (https://en.wikipedia.org/wiki/Pig_(dice_game). A simple dice game for 2 players (split screen). Starter code forked from Jonas Schmedtmann.
- Host: GitHub
- URL: https://github.com/aadewunmi/pig_game
- Owner: AAdewunmi
- Created: 2020-01-10T16:45:59.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-03-04T16:14:55.000Z (about 5 years ago)
- Last Synced: 2025-01-25T06:11:35.101Z (3 months ago)
- Topics: css3, html5, javascript, pig-game
- Language: JavaScript
- Homepage: https://github.com/jonasschmedtmann/complete-javascript-course/tree/master/4-DOM-pig-game/starter
- Size: 1.69 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# The-Pig-Game 🐷

---
## Description:
A simple game, played with one die, which requires a score sheet. Each player in turn throws the die and continues to throw the die until either a 1 is thrown or they decide to stop. If a 1 is thrown they score nothing for that turn. If they elect to stop before a 1 is thrown they score the total of the numbers thrown in that turn. The scores are noted for each turn and the player who obtains a total score over 100, wins the game, provided they are not then out-scored by a subsequent player who has thrown one fewer rolls and still has a turn left.---
## Rules:
- The game has 2 players, playing in rounds:
- In each turn, a player rolls a dice as many times as he wishes. Each result get added to his ROUND score
- BUT, if the player rolls a 1, all his ROUND score gets lost. After that, it's the next player's turn
- The player can choose to 'Hold', which means that his ROUND score gets added to his GLOBAL score. After that, it's the next player's turn
- The first player to reach 100 points on GLOBAL score wins the game
- A player looses his ENTIRE score when he rolls two 6'es in a row. After that, it's the next player's turn.
Players can set the winning score (in an input field), so that they can change the predefined score of 100.---
## Installation:
Download or clone the repository and start the game by opening index.html page in your desired browser.
```sh
$ git clone https://github.com/AAdewunmi/pig_game.git
$ cd pig_game
```---
**Starter code forked from Jonas Schmedtmann.** - [Jonas Schmedtmann]: