Skip to content

Mastermind is a guessing game where players have 10 attempts to guess the location of 4 numbers. Built with React JS.

Notifications You must be signed in to change notification settings

kevinreber/mastermind-game

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mastermind

Mastermind is a game where players have 10 attempts to guess the location of 4 numbers

  demo

Play Game

Source Code

Installation Requirements

Node

To run npm/yarn, you will need Node.js. You can go on official Node.js website and download the installer.

If the installation was successful, you should be able to run the following command.

$ node -v                       # check if node is installed
  v10.16.0                      # version number
$ npm -v                        # check if npm is installed
  6.14.12                       # version number

Setup

After downloading node/npm, you should be able to run the following:

Clone Repository

$ cd [workspace directory]
$ git clone https://github.com/kevinreber/mastermind-game.git

Run Program

$ cd mastermind-game
$ npm install
$ npm start

Open http://localhost:3000 to view project in the browser.

How to Play

demo
  • Player selects a difficulty.
  • Player has 10 attempts to guess the location of 4 numbers in limited time.
  • After each attempt player has 10 seconds to view their results.
  • Game ends when player runs out of attempts or matches all numbers.

Difficulty levels

  • Easy - Timer: 30 seconds, Keyboard Numbers: 0-5
  • Medium - Timer: 25 seconds, Keyboard Numbers: 0-7
  • Hard - Timer: 20 seconds, Keyboard Numbers: 0-9

Goals

  • Display how many attempts player has.
  • Generate 4 random integers using Random.Org API.
  • Numbers must be between 0-7.
  • Player need a way to guess 4 random numbers - make keyboard for mobile users.
  • Results need to be shown after Player has made 4 guesses.
  • Player needs a way to continue game after results displayed.
  • Number of attempts needs to be updated each turn.
  • Player must have a way to view previous results.
  • Notify player when game is over.

Wireframes

design
  • Minimalist approach
  • Desktop & Mobile friendly
  • Reveal answers when game is over

Game Rules

  • Player is only allowed 4 guesses per attempt.
  • Game is not over until player has matched all 4 random numbers or player has 0 attempts left.
  • Player who has matched all 4 random numbers in the least amount of attempts has their number of attempts stored in "Best Score"

Extensions Implemented

  • Difficulty Levels
  • Instructions
  • Timer
  • Animations
  • Media Queries

Extensions To Add/Improve

  • Local Storage
  • Show player history on Results Screen
  • Improve animations
  • Sound
  • Different design for desktop

Built With

  • Sass - CSS preprocessor
  • Axios - Promise based HTTP client for the browser and node.js
  • React.js - Javascript Framework
  • Random.Org - Random number generator API

Authors

About

Mastermind is a guessing game where players have 10 attempts to guess the location of 4 numbers. Built with React JS.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published