From The Odin Project
Build a Mastermind game from the command line where you have 12 turns to guess the secret code, starting with you guessing the computer’s random code.
Use the following command to run the application
- from the root folder:
ruby mastermind/main.rb
OR
- from inside the mastermind folder
ruby main.rb
-
Run the app and choose the setting for the game. The game will indicate who the code-maker and code-breaker are at the start.
-
If Human vs Human: the code-maker will be prompted to enter a secret code while the breaker looks away. If Human vs Computer: the computer will set a code in the background. Afterwards, the code-breaker should then type in code and press enter.
-
After each turn the Guess and Feeback grid should guide the code-breaker on their progress.
-
If the code-breaker breaks the code before they use up all their turns, then they're successful. The Scoreboard is displayed. The code-maker is awarded points equal to the number of tries the code-breaker took to break the code. The more tries taken by the breaker, the better for the maker.
-
New round commences, and the code-maker and code-breaker are switched.
-
After the final round, the Scoreboard is displayed and the winner is announces.