https://github.com/pradeep1991singh/the-game-of-dice
https://github.com/pradeep1991singh/the-game-of-dice
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/pradeep1991singh/the-game-of-dice
- Owner: pradeep1991singh
- Created: 2020-10-04T13:32:51.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2020-10-04T13:48:21.000Z (about 5 years ago)
- Last Synced: 2025-03-20T14:56:09.571Z (8 months ago)
- Language: JavaScript
- Size: 18.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# The Game of Dice
## About Application
- It Builds Players table.
- Generate random Playing order.
- Expose `play` method to play the game.
- Handle `6` point and `consecute 1s` point.
- Print Players table on each dice roll.
- Print Next player name.
- Print points achieved by each player after their turn.
- Call out if a player gets luckcy (achieved `6`) or skipped turn (`consecute 1s`).
- Update ranking when a player completes required points.
- Exclude player if received Rank.
- Print `Game Completed` when all player achieves required points.
## Run standalone program
```sh
# Enter to nodejs Repl
$ node
# Require program
> const GameEngine = require('./GameEngine')
# Create Game application
# It takes N=number_of_playes, M=points_for_game_completion
> let game = new GameEngine(5, 10)
# Play game
> game.play()
```
## Run test
```sh
$ npm test
```