Mastermind Black/White Peg Feedback
Resolve Mastermind duplicate symbols with exact matches reserved before multiset misplaced matches; output per-position allocation uses left-to-right convention, not excess repeated guesses.
Description
Mastermind distinguishes exact-position matches from remaining matching symbols.
Mastermind distinguishes exact-position matches from remaining matching symbols. Multiset consumption prevents overcounting duplicates.1
Enter aligned nonempty secret/guess lists through 128 entries, symbol count 1–100 and integer codes 0–count−1. Return exact and misplaced totals plus 2/1/0 position feedback.
When to use Mastermind Black/White Peg Feedback
Use Mastermind Black/White Peg Feedback when you need to evaluate the supplied records under the calculation and evidence rules below. No code selection, strategy or historical constraint solving is performed.
Prepare the supplied game state, observations and explicit variant settings. Follow the card, board, coordinate and state conventions in the calculation rules.
How to use Mastermind Black/White Peg Feedback and understand its results
- Prepare the supplied game state, observations and explicit variant settings. Follow the card, board, coordinate and state conventions in the calculation rules.
- Enter secretCode, guessedCode, symbolCount using the field table and calculation rules, then run the tool.
- Read blackExactPegs, whiteMisplacedPegs, perPositionFeedback. The explanation below defines the units, signs, ordering and any flags or placeholder values.
- If the tool reports an input issue, correct the values and run it again. Apply the stated assumptions when interpreting a successfully returned result.
| Input field | Meaning | Value type; see rules below | Requirement |
|---|---|---|---|
| secretCode | Secret code | list of number | Required |
| guessedCode | Guessed code | list of number | Required |
| symbolCount | Symbol count | number | Required |
Enter aligned nonempty secret/guess lists through 128 entries, symbol count 1–100 and integer codes 0–count−1. Return exact and misplaced totals plus 2/1/0 position feedback.
exact first; then consume remaining secret symbols left to right Units, indexing, boundary conditions and exceptional cases are defined in the calculation rules above.
| Output field | Meaning | Value type |
|---|---|---|
| blackExactPegs | Black exact pegs | number |
| whiteMisplacedPegs | White misplaced pegs | number |
| perPositionFeedback | Per position feedback | list of number |
{
"input": {
"secretCode": [
1,
1,
2,
3
],
"guessedCode": [
1,
2,
1,
1
],
"symbolCount": 6
},
"output": {
"blackExactPegs": 1,
"whiteMisplacedPegs": 2,
"perPositionFeedback": [
2,
1,
1,
0
]
}
} Limitations and assumptions
No code selection, strategy or historical constraint solving is performed.
Numeric inputs, where present, must be finite. Follow the calculation-specific rules for overflow, underflow and exceptional cases. Numeric lists are limited to 10,000 entries; string lists to 128 strings of at most 128 characters each. The rules above may impose smaller limits. Missing required fields, extra fields, wrong value types and violations of the calculation rules are input errors.
Alternative or Complementary methods
Use Wordle Green/Yellow/Gray Feedback Pattern: Wordle feedback must account for repeated letters. Exact matches consume answer letters before misplaced matches. For a complementary task, use Kakuro Row Sum Distinct Digits Check: A Kakuro run uses distinct digits 1–9. Unknown cells can be checked by enumerating remaining digit combinations.
References
-
Mastermind Black/White Peg Feedback — tool.io
Similar or alternative tools
- Wordle Green/Yellow/Gray Feedback Pattern
Wordle feedback must account for repeated letters. Exact matches consume answer letters before misplaced matches.
- Kakuro Row Sum Distinct Digits Check
A Kakuro run uses distinct digits 1–9. Unknown cells can be checked by enumerating remaining digit combinations.