Code Monkey home page Code Monkey logo

mastermind_game's Introduction

Mastermind Game

mastermind.c

Original author: Neil Ranada

This is a command line game where you have to guess a four digit secret code using non-repeating numbers between 0 and 7 (Example: 0357).

You can play by yourself against a random auto-magically generated secret code.

Or, set a custom four digit code using non-repeating numbers between 0 and 7 and set the number of attempts available to a player (default is 10 attempts).

How to install

  • You can download the project folder and files manually to your computer or fork the Github repo at: https://github.com/Ranada/mastermind_game
  • Or through your terminal, clone this repository: git clone https://github.com/Ranada/mastermind_game
  • Go to the directory containing this project: cd mastermind_game
  • Check to see you have a GCC compiler installed: gcc --version (if not installed, consider using Homebrew method: https://formulae.brew.sh/formula/gcc)
  • Compile automatically using the makefile using make or manually gcc -Wall -Wextra -Werror *.c -o play_mastermind

How to play

To play against a randomly generated secret code

  • In the command line type ./play_mastermind
  • Enter your four digit guess (using numbers between 0 and 7) in the command line until you run out of attempts

To play with custom settings

  • To set only the custom four digit code, add a "-c" flag add a four digit number (using non-repeatind numbers between 0 and 7): ./play_mastermind -c 1234
  • To set only the number of attempts add a "-t" flag and add the desired number of attempts: ./my_mastermind -t 20
  • To set both the secret code and number of attempts a "-c" and "-t" flag and update the numbers in the example: ./play_mastermind -c 1234 -t 10
  • The player enters a four digit guess (using numbers between 0 and 7) in the command line until they run out of attempts

mastermind_game's People

Contributors

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