Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ghulamghousdev/pig-dice-game
🎲🏆🎲 A simple dice game with two players. Each player repeatedly rolls a die until either a 1 is rolled or the player decides to "hold". The player who first scores 100 or more points wins. https://ghulamghousdev.github.io/Pig-Dice-Game
https://github.com/ghulamghousdev/pig-dice-game
css games html javascript javascript-game pig-dice pig-game projects
Last synced: 18 days ago
JSON representation
🎲🏆🎲 A simple dice game with two players. Each player repeatedly rolls a die until either a 1 is rolled or the player decides to "hold". The player who first scores 100 or more points wins. https://ghulamghousdev.github.io/Pig-Dice-Game
- Host: GitHub
- URL: https://github.com/ghulamghousdev/pig-dice-game
- Owner: ghulamghousdev
- License: mit
- Created: 2020-04-02T11:09:39.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-04-02T14:03:51.000Z (over 4 years ago)
- Last Synced: 2024-10-11T19:24:52.149Z (3 months ago)
- Topics: css, games, html, javascript, javascript-game, pig-dice, pig-game, projects
- Language: JavaScript
- Homepage:
- Size: 1.47 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Pig Dice Game
#### A simple dice game with two players. Each player repeatedly rolls a die until either a 1 is rolled or the player decides to "hold". The player who first scores 100 or more points wins.## Description
This is a simple dice game where two players have the chance to roll the dice to try and achieve a score of 100. Each player repeatedly rolls a die until either a 1 is rolled or the player decides to "hold".The rules of the game are:
* When a player rolls a 1, their total score reverts to 0 and it becomes the next player's turn.
* When the player rolls a 2 - 6, the score is added to their turn total and they can continue to play
* When the player chooses to "hold", their turn total is added to their total score, and it becomes the next player's turn.
* The player who first scores 100 or more points wins.## Specifications
1. It can display the inputted name of the players when 'Play' is clicked asPlayer1
Player2
2. Player1 can roll the dice and the result displayed as their turn score.
* Input:
'Roll' button is clicked
Dice Score: 3
* Output:
Turn Score: 6
3. Player1 can hold the dice and their turn total score is added to their total score. Player2 then has the chance to play.
* Input:
'Hold' button is clicked.
* Output:
Turn Score: 3
Total Score: 9
4. Player2 can roll the dice and the result displayed as their turn score.
* Input:
'Roll' button is clicked
Dice Score: 2
* Output:
Turn Score: 5
5. Player2 can hold the dice and their turn score is added to their total score. Player1 then has the chance to play.
* Input:
'Hold' button is clicked.
* Output:
Turn Score: 4
Total Score: 9
6. If a player's dice score is a 1, their turn score will be reduced to 0.
* Input:
'Roll' button is clicked
Dice Score: 1
* Output:
Previous Turn Score: 30
New Turn Score: 0
## Setup/Installation
To view the website, click [Pig Dice Game](https://ghulamghousdev.github.io/Pig-Dice-Game) or copy (https://ghulamghousdev.github.io/Pig-Dice-Game) to your browser and load it.## Known Bugs
No known bugs.## Technologies Used
* HTML
* CSS
* JAVASCRIPT## Licence
MIT ©2020 [Ghulam Ghous](https://github.com/ghulamghousdev)