Codebreaker (Mastermind)

Mastermind Codebreaker

Deduce a hidden 4-color combination within 8 attempts. Each submission reveals precise feedback: green pegs indicate exact position matches, and amber pegs indicate correct colors in the wrong position.

Exact Match (Green)

Correct color in the correct position.

Color Match (Amber)

Correct color, but misplaced position.

Challenge at a Glance

Focus
Combinatorial Deduction & Information Theory
Best For
Programmers, cybersecurity enthusiasts, cryptographers, and puzzle fans
Privacy
100% in your browser: scores are never uploaded
Duration
2–5 Minutes
Cost
Free Forever
Verified
November 2026

Task Objective & Session Structure

Primary Objective

Find the hidden 4-color code in as few guesses as possible, within a maximum of 8 guesses.

Session Format

Untimed, turn-based puzzle with up to 8 guesses per secret code

How to Play (Step-by-Step)

1

Start the game

Click Start Cracking Code. The game hides a new secret code of 4 different colors.

2

Build a guess

Click colors in the palette to fill the 4 slots, left to right. Use Backspace to remove the last color.

3

Submit and read feedback

Click Submit Guess. Green means right color in the right place; amber means right color in the wrong place.

4

Crack it in 8 guesses

Use the history of past guesses to narrow the possibilities. Four green pegs wins; 8 guesses without a win reveals the code.

Supported Input Controls

In-Game ActionInput Method / Shortcut
Place a colorClick a color swatch in the palette
Remove the last colorClick the Backspace button
Submit a guessClick Submit Guess once all 4 slots are filled
Start a new gameClick Start Cracking Code

Trial Mechanics & Lifecycle

Code Creation

Scoring Impact

The game shuffles the 6 colors and takes 4, so the secret code never repeats a color. There are 360 possible codes.

Sets the hidden state; no points yet.

Guess Entry

Scoring Impact

You click palette colors to fill 4 slots in order. Your own guesses may repeat a color; the Backspace button removes the last color placed.

No score effect until you submit.

Feedback

Scoring Impact

Submitting compares your guess to the code: green pegs count exact matches, amber pegs count colors that appear in the code but in a different position.

Each submitted guess uses up one of your 8 attempts.

Win or Loss

Scoring Impact

Four green pegs wins and shows your score. After 8 guesses without a win the game ends and reveals the code.

A win scores 1,000 minus 100 per guess used; a loss scores nothing.

Scoring & Benchmark Tiers

Scoring Formula

Score on a win = 1,000 − (100 × guesses used), with a minimum of 100. Solving on guess 1 scores 900, guess 4 scores 600 and guess 8 scores 200. If the code is not cracked in 8 guesses the game ends without a score.

No points are lost for wrong guesses directly; each guess simply lowers the possible maximum by 100, and failing to solve within 8 guesses earns nothing.

Performance Benchmarks
Sharp Deducer

600 points or more (solved in 4 guesses or fewer)

Efficient elimination with few wasted guesses.

Steady Solver

300 – 500 points (5 to 7 guesses)

Reached the answer with careful but slower deduction.

Late Finisher

200 points (8 guesses)

Solved on the final attempt.

Cognitive Faculties Exercised

Hypothesis Elimination

Using each piece of feedback to rule out codes that cannot be the answer.

Constraint Checking

Making sure a new guess is consistent with the feedback from all earlier guesses.

Systematic Planning

Choosing guesses that reveal the most information with the fewest attempts.

Scientific Background & Paradigm

Invented by Mordecai Meirowitz in 1970, Mastermind is an adaptation of the century-old pencil-and-paper game Bulls and Cows. In 1977, computer scientist Donald Knuth published a five-guess algorithm proving that any code can be solved in at most five turns using a minimax information-theoretic strategy.

Gameplay Strategy & High-Score Tips

Open with four different colors

Because the secret never repeats a color, a first guess of 4 different colors tells you quickly how many of those colors are in the code.

Remember the code has no repeats

A guess with the same color twice wastes a slot, because that color can appear at most once in the secret.

Rearrange before replacing

If you get amber pegs, keep those colors and change their positions. If a guess returns no pegs, none of its colors are in the code.

Check every old guess

Before submitting, make sure your new guess would have produced the same feedback as all your earlier guesses.

Non-Clinical Educational Disclaimer

  • Designed for recreation and learning; it is not a professional cryptanalysis tool.
  • The game is untimed and has a single difficulty setting with no repeated colors in the secret code.
  • Pegs are distinguished by color alone, so players with color vision differences may find the palette harder to use.

Frequently Asked Questions

No. The game picks 4 different colors from the 6 available, so every color appears at most once in the secret. You may repeat colors in your own guesses.

More Mind Suite challenges

See all 32 challenges