Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 

Repository files navigation

Mastermind Game (Python)

A terminal-based implementation of the classic Mastermind game developed in Python.

This project was created to learn how python handles core programming concepts such as:

  • functions
  • loops
  • input validation
  • dictionaries and lists
  • game logic
  • algorithmic thinking

How the Game Works

The computer generates a secret combination of colors.

Your objective is to guess the correct sequence within a limited number of attempts.

After each guess, the game provides feedback:

  • Correct position → correct color in the correct spot
  • Incorrect position → correct color in the wrong spot

Colors can be repeated in the secret code.


Valid Colors

Letter Color
R Red
G Green
B Blue
Y Yellow
W White
O Orange

Example

Welcome to Mastermind, you have 10 tries to guess the code!
The valid colors are: R G B Y W O

Type guess: R G B Y

Correct position: 2 | Incorrect position: 1

Technologies Used

  • Python 3
  • Standard Library (random)

How to Run

1. Clone the repository

git clone https://github.com/texlucas/mastermind-python.git

2. Open the project folder

cd mastermind-python

3. Run the game

python game.py

Project Structure

mastermind-python/
│
├── game.py
└── README.md

Features

  • Random code generation
  • Input validation
  • Duplicate color handling
  • Attempt tracking
  • Feedback system for guesses
  • Replayable terminal game

Possible Future Improvements

  • Difficulty levels
  • Colored terminal output
  • Replay option
  • Score system
  • Unit tests
  • GUI version using Tkinter or Pygame
  • Multiplayer mode

Author

Developed by Lucas Teixeira as a learning project while studying Python fundamentals.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages