Skip to content

Latest commit

 

History

History

mastermind

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

Project: Mastermind

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.

Usage

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

Examples

  1. 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. Image one

  2. 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. Image two

  3. After each turn the Guess and Feeback grid should guide the code-breaker on their progress. Image three

  4. 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. Image four

  5. New round commences, and the code-maker and code-breaker are switched. Image five

  6. After the final round, the Scoreboard is displayed and the winner is announces. Image six