Skip to content

stefan-girlich/node-monty-hall-problem

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

node-monty-hall-problem

This little Node.js application brings the Monty Hall problem to your shell as an interactive game; retro swag is provided by emoji and ANSI colors. You can play as many rounds of the game as you like and check the statistics at any time.

Installation

git clone https://github.com/stefan-girlich/node-monty-hall-problem
cd node-monty-hall-problem
npm install

Usage

npm test	# execute all unit tests
npm start	# start the actual game
  • Simply follow the on-screen instructions.
  • For each prompt, type one of the given options and confirm by pressing Enter.
  • At any prompt, enter ? to view the current statistics.
  • To leave the application, simply terminate it by pressing Ctrl+C or Cmd+C.

Configuration

The configuration can be changed in the file config.json. It contains the following top-level sections:

-

  • breakDuration How long should the game be paused between rounds? (seconds)

game

Configuration for the actual game logic.

  • doorCount How many doors should be in the game? (min. 3)

symbols

Emoji to be used to represent game objects.

texts

On-screen texts.

allowedInput

Mapping of user input to multiple-choice answers in the command line prompt.

Thanks

Thanks to Hsin Yu for inspiring me to write this little application :)

About

Command-line application illustrating the Monty Hall problem

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published