Skip to content

teresafinn/mastermind

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mastermind

What is it?

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.

Rules of the Game

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!

  1. Press p to play. The game will prompt you to enter your guess.
  2. Input your guess: R for red, G for green, Y for yellow, and B for blue. Guesses are case insensitive.
  3. 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.
  4. 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.
  5. When you guess the correct position of all the colored pegs, you win!

I Learned How to...

  • 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

About

Mastermind Project

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Ruby 100.0%