This version of Mastermind is played with a command-line interface. In order to play, clone the repo and install the files on to your machine. Run the game from the command line by typing rake play
from the directory in which you installed the file. You can see the test suite run by typing rake test
.
The goal of the game is to guess the correct color and position of four pegs automatically generated by the computer. The fewer guesses, the better!
- Press
p
to play. The game will prompt you to enter your guess. - Input your guess: R for red, G for green, Y for yellow, and B for blue. Guesses are case insensitive.
- You will receive feedback as to which colors/positions in your guess were correct. If you guessed a color correctly but it is in the wrong position, the game will alert you. You will be prompted to enter another guess until all the colors/positions are correct.
- As you play, the game will keep track of the number of attempts to solve the problem. Try to win with the fewest possible guesses.
- When you guess the correct position of all the colored pegs, you win!
- Design an object-oriented program and encapsulate code
- Use TDD with Minitest to guide program development
- Use a variety of enumerable methods including map, zip, reject, and each
- Code a command-line interface game that accepts input from users