Code Monkey home page Code Monkey logo

mastermind's Introduction

Mastermind

Mastermind is a game that runs in a REPL interface. This game requires the colorize gem. Install the colorize gem by running in your terminal the command:

gem install colorize

To clone the application from GitHub in order to run:

git clone git@github.com:kbhoffmann/Mastermind.git

To start playing the game, in your terminal run:

ruby mastermind.rb

Mastermind is built with Ruby 2.7.2 and RSpec version 3.10.

Tests may be run by typing in your terminal:

rspec spec/filename_spec.rb

-Tests are organized by the first file as the spec/game_spec.rb file which gives welcomes the player and invites them to play "Mastermind." The player may choose to play, get instructions, or quit.

-The second file, spec/secret_spec.rb, tests the random generation of the computer code, which is an array of 4 colors.

-The next test file is spec/guess_spec.rb which tests the input of the player as as a single string of 4 lower case letters corresponding to colors. It tests to make sure the guess is the appropriate length of 4. If length is greater than or less than 4, the player will be informed of the error and instructed to guess again. The player may also select to quit, get instructions, or cheat and get the secret answer.

-The last test, the feedback_spec test file compares the player's guess to the computer's secret and gives the player feedback as to the accuracy of their guess, as well as how many guesses they have taken. If the player wins, it tells the player how long it took them to guess the correct answer and in how many guesses.

This project was the first paired project in our Turing program. We faced challenges of defining our roles within the project, planning how to divide and conquer so we may code in an asynchronous manner, as well as working together in a driver/navigator approach. Learning how to work together proved to be challenging, yet rewarding. As partners, we both had different thought processes and may have had different ways to solve problems. Having two heads can definitely be better than one. Sometimes one of us saw something the other didn't and one of us may have been stronger in one area than another. Learning to set expectations for time and work as well as using clear communication helped us be successful in creating our first functioning game. Those things will also be valuable in future projects with different partners.

Authors Billy Frey and Kerri Hoffmann

mastermind's People

Contributors

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