🎯 Mastermind

Guess and guess the hidden four color schemes. Solve the puzzle within 10 times using the clues on the black pin (correct position and color) and the white pin (correct color only)!

🌐 Online Battle
remaining tries10
Select a color and click a cell

way of playing (a game)

  • Select a color from the color buttons above and click on the four squares to place the color
  • Press the "Confirm" button to display the results of the deduction.
  • Black pin = correct color and position / White pin = correct color but wrong position
  • You can use the same color more than once. 4 black pins within 10 times is enough to clear the puzzle!

What is Mastermind WEB?

Mastermind WEB is a code-breaking puzzle game where you decipher a hidden four-color sequence through systematic guessing. Each guess receives feedback via colored pegs: black pegs indicate correct colors in correct positions, while white pegs show correct colors in wrong positions. This classic logic game sharpens deductive reasoning skills and teaches systematic problem-solving approaches. Mastermind has entertained strategists and puzzle enthusiasts since the 1970s, combining luck-based elements with strategic thinking.

How to Use

Select four colored pegs to form your guess, then submit to see the feedback. Black pegs show how many colors you placed correctly in the right positions. White pegs indicate correct colors positioned incorrectly. Use this feedback to narrow down possibilities on your next attempt. If you guess all four colors in the correct order, you win immediately. Start with educated guesses rather than random selections—selecting diverse colors first reveals which colors exist in the code. Adjust subsequent guesses based on feedback, systematically eliminating impossible combinations.

Use Cases

Mastermind suits players developing logical thinking and deductive reasoning skills:
• Students studying discrete mathematics use it to understand constraint-satisfaction problems
• Puzzle enthusiasts challenge themselves to solve codes in minimum guesses
• Educators employ Mastermind as a classroom tool to teach algorithmic thinking
• Families gather for casual competition during game nights
• Professional problem-solvers appreciate how it mirrors real-world troubleshooting methodologies

Tips & Insights

Start with diverse color combinations like red, yellow, blue, green—this reveals which colors exist in the code immediately. Never repeat failed combinations verbatim; analyze feedback patterns to eliminate possibilities mathematically. If two guesses reveal the same feedback, their positions likely didn't matter. Advanced players use information theory principles to maximize feedback per guess. The game's depth comes not from luck, but from how systematically you analyze feedback and adjust your strategy accordingly.

Frequently Asked Questions

What are the rules?

This is a game of guessing the color scheme of the four colors. A black pin means "both color and position are correct", and a white pin means "color is correct but position is wrong".

Can I use duplicate colors?

Yes, you can use more than one of the same color.

How many times can you guess?

You can guess up to 10 times; if you guess within 10 times, you succeed.

How to read the clues?

Up to four pins are shown for each guess. The number of black pins + the number of white pins is the total number of correct guesses. The position of the pins does not correspond to the color position.

What's the best strategy to win Mastermind?

Start with a guess that spreads out colors (like 1-2-3-4) to gather maximum information about which colors are in the code. Then use the black and white peg feedback to progressively eliminate possibilities and narrow down both correct colors and their positions.

What happens if I use all 10 guesses without solving the code?

If you reach 10 incorrect guesses, the game ends and you lose—the hidden code is revealed so you can see what you were trying to crack. You can then start a new game immediately to try again.

Can the hidden code contain all four positions with the same color?

Yes, it's possible for the hidden code to be all one color (e.g., 1-1-1-1), making it an especially tricky puzzle. This scenario would give you 4 black pegs immediately if guessed, so it does happen but is relatively rare.

How many different possible color codes exist in this game?

With 6 available colors and 4 positions where duplicates are allowed, there are 1,296 possible combinations (6^4). This large number of possibilities is why good deduction strategy is key to solving the puzzle efficiently.

Is there a difficulty setting for different skill levels?

The current version has a standard difficulty with 6 colors and 10 guesses. The challenge is consistent, but the puzzle naturally gets harder if you need more strategic thinking to deduce the code efficiently.

Can I play Mastermind against another person on the same screen?

This version is single-player against the computer-generated hidden code. You could play with a friend by taking turns as the 'codemaker' in separate games, but the game itself doesn't have a built-in two-player mode.