Coder Social home page Coder Social logo

javitocor / mastermind_ruby Goto Github PK

View Code? Open in Web Editor NEW
5.0 1.0 0.0 38 KB

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.

License: MIT License

Ruby 100.00%
ruby classic-game code project rspec

mastermind_ruby's Introduction

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!

mastermind_ruby's People

Contributors

javitocor avatar

Stargazers

 avatar  avatar  avatar  avatar  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.