Giter Club home page Giter Club logo

mastermind-2p's Introduction

Mastermind Game

Mastermind is a game where one player chooses a secret code, and the other player tries to guess it.

Overview

  • Player 1 inputs a secret code.
  • Player 2 tries to guess the secret code.
  • Player 2 receives feedback on how many numbers they got right and how many are in the correct location.
  • The game ends either when Player 2 guesses the correct code or after 10 incorrect guesses.

Features

  • The secret code entered by Player 1 is not displayed on the screen, ensuring privacy.
  • Provides feedback on the number of correct numbers and correct locations.
  • Provides feedback on when Player 2's guess length does not match Player 1's secret length.

How to Run

  1. Ensure you have Python installed on your machine.
  2. Save the provided code in a file named mastermind.py.
  3. Navigate to the directory containing the file via the command line or terminal.
  4. Run the script by entering python mastermind.py.
  5. Follow the on-screen instructions to play.

Game Rules

  1. Player 1 will be prompted to enter a secret code. This will not be visible on the screen to keep it a secret.
  2. Player 2 will have 10 attempts to guess the secret code.
  3. After each guess, Player 2 will be provided feedback on:
    • The number of correct numbers.
    • The number of numbers in the correct location.
    • The game ends when either Player 2 guesses the code correctly or uses up all 10 attempts.

mastermind-2p's People

Contributors

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