An open API service indexing awesome lists of open source software.

https://github.com/palashhawee/pig-game

Implemented Pig Game Algorithms
https://github.com/palashhawee/pig-game

algorithms javascript pig-game project

Last synced: 11 months ago
JSON representation

Implemented Pig Game Algorithms

Awesome Lists containing this project

README

          

# PIG GAME

## Demo

https://pig-game-hawee.netlify.app/

## Algorithms
### step 1:
#### Roll the dice:
The current player has to roll the dice and then a random number will be generated. If current player gets any number other than 1 on the dice then that number will be added to the current score (initially the current score will be 0) and then the new score will be displayed under Current Score section. Note: If the current player gets 1 on the dice then the players will be switched i.e. the current player will become in-active and vice-versa.
### Step 2:
#### Hold:
If the current player clicks on HOLD, then the Current Score will be added to the Total Score. When the active player clicks the Hold button then the total score is evaluated. If the Total Score >= 50 then the current player wins else the players are switched.
### Step 3:
#### Reset:
All the scores are set to 0 and Player 1 is set as the starting player (current player).

## Flow Chart

![Flow Chart](https://github.com/PalashHawee/pig-game/blob/main/pig-game-flowchart.png)

## Making of game
Being a game rendered by the web browser, it is built by the help of HTML, CSS (for the Front-end) and JavaScript (for the Back-end). The main logic of the game lies in the JS file whereas the appearance and the User Interface is rendered by HTML and CSS.
## Authors

- [@palashhawee](https://github.com/PalashHawee)