Skip to content

javitocor/Mastermind_Ruby

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mastermind

I built a mastermind game on the command line. A human player can either solve the game themselves, or two users can play, one as the codemaker and the other as the player.

screenshot

What it does

One player plays Mastermind game

Built With

  • Ruby
  • VSCode

Live demo

You can find it here Run on Repl.it

Getting Started

Clone the project on your local machine, cd to the folder, and then run "./bin/start.rb" on your terminal

Instructions to Play

  • Select the player name.

  • Select who wants to be the codemaker, the computer or a player.

  • The code can be made up of any combination of the colored pegs. You may not use two or more pegs of the same color.

  • The colors are red, green, brown, magenta ,blue and cyan.

  • Once the code is set, the Decoder can begin guessing, trying to duplicate the exact colors and positions of the hidden Code pegs.

  • Each guess is made by placing a row of Code pegs on the unit.

  • After every guess, the result of fails and matches will be displayed.

  • Player has 15 tries.

Prerequisites

  • Install Ruby's latest version.

Install

  • Install VSCode or any code editor you like
  • Install latest version of Ruby

Run tests

  • Run 'rspec' in the main directory

Author

👤 Javier Oriol Correas Sanchez Cuesta

Future Features

  • Add AI to the game so it can play itself

🤝 Contributing

Contributions, issues and feature requests are welcome! Start by:

  • Forking the project
  • Cloning the project to your local machine
  • cd into the project directory
  • Run git checkout -b your-branch-name
  • Make your contributions
  • Push your branch up to your forked repository
  • Open a Pull Request with a detailed description to the development branch of the original project for a review

Attributions and Credit 🚀

Show your support

Give a ⭐️ if you like this project!

📝 License

Check out my stories on medium to see what I'm talking about! Follow me on Instagram and Twitter to see what I am up to!

Enjoy!

About

Classic Mastermind game in command line built with Ruby by following OOP. Users can play this classic game being the code maker or the decoder.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages