Giter Site home page Giter Site logo

mastermind's Introduction

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

mastermind's People

Contributors

teresafinn avatar jcasimir avatar rwarbelow avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.