Brainmaster solver

    Codemaker's answer

    Tap the pins the codemaker placed for the current row.

    Greyed answers are impossible given the earlier answers. If the codemaker gives one, an earlier row was probably scored wrongly; use Undo.

    Remaining codes

    Settings

    Colours
    6
    Positions
    4

    How to use it

    1. Someone else picks a secret code (colours may repeat) and keeps it hidden.
    2. Play the guess shown in the highlighted row. You may tap a peg to play a different colour instead.
    3. The codemaker answers with pins: black = right colour in the right place, white = right colour in the wrong place. Tap that answer below the board.
    4. Repeat until four black pins. Undo takes back the last row.

    How it thinks

    The app keeps an explicit table of every possible secret (1296 for 6 colours) and crosses out each one that contradicts an answer. All remaining codes are equally likely.

    Each guess is an experiment. Its information gain is the expected reduction in uncertainty (in bits) about the secret — the entropy of how the guess splits the remaining codes over the possible answers. The app ranks every possible guess by information gain and then:

    With 6 colours and 4 positions this averages 4.340 moves (5625 guesses over all 1296 secrets), which is exactly the proven optimum, and never needs more than 6.

    Read the full method and analysis: the maths, how it compares with other strategies, and timings.

    Statistics