How to Play Mastermind
Master the classic code-breaking game with this complete guide
🎯 The Objective
The computer creates a secret code using colored pegs. Your goal is to crack the code by making guesses and using the feedback to narrow down the possibilities.
Win Conditions
You Win: Guess the exact code before running out of attempts
Bonus: Solve faster with fewer guesses to earn more points!
📋 Game Rules
The Secret Code
Difficulty Levels
💡 Important: Colors CAN repeat in the code! For example, the code could be Red-Red-Blue-Yellow.
Making Your Guess
Click on each position to open the color picker
Select a color for that position
Fill all positions in the row
Click "Submit Guess" to check your answer
📸 Screenshot: Color selection interface
Add image: /public/screenshots/how-to-play/color-selection.png
Understanding Feedback
After each guess, you receive feedback pegs that tell you how close you are to cracking the code:
Black Peg ⚫
Most valuable feedback
Meaning: Right color in the RIGHT position
Example: If position 1 in your guess is Red and position 1 in the secret code is also Red, you get a black peg.
✓ Keep that color in that exact position!
White Peg ⚪
Partial match
Meaning: Right color but WRONG position
Example: If your guess has Blue in position 1, and the secret code has Blue in position 3, you get a white peg.
⚠ This color is in the code, but you need to move it!
No Peg (Empty)
Color not in code
Meaning: This color is NOT in the secret code at all
Example: If you guess Yellow and get no feedback peg for it, Yellow is not in the code.
✗ Eliminate this color from future guesses!
🚨 CRITICAL: Feedback Order
The feedback pegs are NOT in the same order as your guess! They only tell you how many colors are correct, not which positions they're in (except for black pegs which confirm correct position).
🧠 Winning Strategies
For Beginners
1. Start with Different Colors
Use all different colors in your first guess (e.g., Red-Blue-Green-Yellow). This helps you eliminate colors quickly.
2. Process Elimination
If a color gets no feedback peg, never use it again. This narrows down possibilities fast.
3. Lock In Black Pegs
If you get a black peg, keep that exact color in that exact position for all future guesses.
4. Rearrange White Pegs
White peg colors need to be moved. Try them in different positions systematically.
Advanced Techniques
🎯 Test One Variable
Change only one color at a time between guesses to isolate which change affected the feedback.
🔄 Rotation Method
If you know the colors but not positions, rotate them systematically through each position.
📊 Track Patterns
Keep mental notes of which colors gave feedback. Build a mental map of possibilities.
⚡ Speed Solving
For races, use aggressive guessing once you narrow it to 2-3 possibilities.
📝 Example Game
Let's walk through a sample game on Easy mode (4 positions, 6 colors):
Guess 1:
🔵 Red - Blue - Green - YellowAnalysis: One color is in the right position, one color is correct but in wrong position. Two colors are not in the code at all.
Guess 2:
🟣 Red - Yellow - Blue - OrangeAnalysis: Now we have 2 colors in correct positions! One more color is right but in wrong spot. We're getting close.
Guess 3:
🟢 Red - Orange - Blue - Yellow🎉 Success! We cracked the code in 3 guesses. The secret code was Red-Orange-Blue-Yellow.
⚠️ Common Mistakes to Avoid
❌ Don't Do This
- • Ignoring feedback from previous guesses
- • Re-using colors that got no feedback
- • Changing too many colors at once
- • Forgetting which positions gave black pegs
- • Random guessing without logic
- • Giving up after a few wrong guesses
✅ Do This Instead
- • Build on feedback from each guess
- • Eliminate colors that aren't in the code
- • Test one change at a time when possible
- • Lock in positions that gave black pegs
- • Use logical deduction and patterns
- • Stay patient and methodical
💰 Points & Scoring
How Points Work
- • Base points: 10-100 pts per game
- • Speed bonus: Faster = more points
- • Efficiency bonus: Fewer guesses = more points
- • Difficulty multiplier: Hard mode = 3x points
- • Streak bonus: Win streaks increase rewards
Maximize Your Score
- • Solve in 3-4 guesses for best efficiency
- • Complete games quickly for time bonus
- • Play higher difficulties for multipliers
- • Maintain win streaks for bonus points
- • Win daily challenges for 200+ points
💡 Quick Tips for Success
Practice Makes Perfect
The more you play, the better you'll recognize patterns
Think Logically
Every guess should eliminate possibilities
Balance Speed & Accuracy
Fast solves earn bonus points, but wrong guesses waste time
New to the game? Check out our Getting Started guide