perplexd

Today’s Ladder is on the home page →

How LockCode works

The code is four different digits, 0–9. Before you guess anything you are given four clues. Each clue is a test code with two numbers: how many of its digits are in the secret code and in the right position (the green square), and how many are in the code but in the wrong position (the amber circle). The feedback is a count, not a map — it never tells you which digits are right. That is the whole game: turning counts into certainty.

Every day the generator checks how many codes are still possible after the four clues and keeps the count between eight and twelve. So a puzzle is never a lottery — it is always solvable by reasoning, and usually in three or four guesses. The keypad greys out any digit that cannot be in the code given everything you know, and the counter above your guess tells you how many codes are still possible.

A method that solves it in four guesses

  1. Start with the “nothing” clue. If a clue scored zero, its four digits are out; only six digits remain and the puzzle shrinks from 5,040 codes to 360 in one step. If no clue scored zero, look for two clues that share digits and compare their totals.
  2. Separate membership from position. Work out which digits are in the code before worrying about where. Add a clue’s green and amber counts: that is how many of its digits are members. Two clues with three digits in common and different totals tell you about the digit they do not share.
  3. Use a probe guess, not a hopeful guess. When a few codes remain, pick the guess whose feedback would be different for each remaining candidate, even if that guess cannot itself be right. One probe usually leaves a single possibility.
  4. Lock positions last. Green means right place; a digit that is amber in one guess and green in another has just told you its column.

Worked example. Clues: 0123 → nothing, 4567 → 1 green 1 amber, 4589 → 2 green, 6789 → 1 amber. The first clue removes 0–3. The third says two of 4, 5, 8, 9 are right-placed; the second says exactly two of 4, 5, 6, 7 are in the code, one placed. The fourth says exactly one of 6, 7, 8, 9 is in the code. Combining: 4 and 5 are both in and placed (they are the only overlap that satisfies both totals), 8 and 9 are out, and exactly one of 6 or 7 is in but misplaced — so the code is 45 followed by one of 6 or 7 in the wrong column plus one digit from the remaining pool. Two candidates remain; one guess settles it.

Why counts, not colours per digit?

Wordle-style per-letter feedback tells you a lot per guess and makes the game about vocabulary. Mastermind-style count feedback tells you less per guess and makes the game about inference — the satisfaction is the moment two clues intersect and a digit is suddenly certain. LockCode keeps the count model and adds a fixed set of opening clues so the first guess is already a deduction rather than a shot in the dark.

Sharing

Your result copies as a grid: one row per guess, green squares for right-place digits, yellow for wrong-place, black for misses, and a 3/6 score. It never contains the code, so it is safe to post before your friends have played. Compare rows — a clean 🟩🟩🟩🟩 on the third line is the LockCode equivalent of a Wordle hole-in-two.

Yesterday’s code, with a full deduction walkthrough, is in the archive. For the general method, read how to crack any 4-digit Mastermind code in four guesses.