The game mid-move: a Sudoku board on the left; on the right, the step function's summarized thinking streams in while the next move waits its turn.

Postmodern Sudoku: A Sudoku in Which Every Function Is a Prompt

Challenging the assumption that a rule is something a computer calculates.

I wrote an ordinary Sudoku as pure functions, then wrote it again with every function name and signature unchanged and every body replaced by a one-line description. A language model is asked to be each function: it gets the description and the arguments, has no tools and cannot run code, and has to work out the return value. A JSON schema fixes the shape of each answer; nothing checks whether it is true. You place a digit, and everything that comes back (the new board, whether the move was legal, which cells clash) is performed by the model, sometimes wrongly.

Role
Concept, design, direction
Built
December 2026
Platform
Web & terminal
Performer
Claude Haiku 5.5, low effort

What I did: The concept, directing the 25 function descriptions, play-testing, the decisions on caching, waiting and conflicts, and holding the API key for a cost-capped deployment

Tools: Claude Code, Python, plain JavaScript, Cloudflare Pages, D1 and KV

“The core is to use Sudoku to show hallucination in a way that’s fun.”

Design note, during the build
How might we

How might we make a language model’s confident mistakes visible at a glance, to people who have never read a line of its output?

01

The Experience

Two 1s placed side by side in the top row. The performer says the second conflicts with the first; the row lights faintly and both 1s light strongly.
The board answers with the performer’s own verdict. Here it reports a clash in row 1: the row lights faintly, the two 1s strongly.
The wall text: a step call drawn as the board it was given and the board it returned. Claude’s message puts the full stop before the bracket, arithmetic’s after it, so the call is marked with a cross.
Wall text: each call drawn as the board it got and the board it returned. This ✗ is one misplaced full stop
The performer column: the last verdict, the next move waiting its turn, and step’s summarized thinking streaming in.
While it decides, Claude’s summarized thinking streams in and your next move waits its turn
The game on a phone: the top rows of the board, with a reported conflict in row 1.
The same game on a phone
02

Design Process

One program, written twice

The plain version keeps all data immutable and every function pure; input and output happen only in a thin outer loop, the shell. The second version keeps every name and signature and swaps each body for a sentence:

sudoku/core.py · computed
def is_valid_move(board, r, c, v):
    return v in DIGITS and all(
        board[i][j] != v
        for i, j in peers(r, c))
llm_sudoku/core.py · performed
def is_valid_move(board, r, c, v):
    return llm.request(
        "return true iff v is a digit from 1 to 9 and no other cell in the same row, column or 3x3 box as (r, c) already holds v; …",
        inputs=…, returns=llm.BOOL)

A useful side effect: in the computed version, one move runs step, which calls is_valid_move, which calls peers, and so on down. In the performed version step is one sentence, and all of that disappears into whatever the model does when it reads it. On the web, a move costs two calls: parse_command, then step.

By the numbers

25functions, each a sentence
2calls per move on the web: parse, then step
2–5 sper move call on Haiku; a new board takes about 14 s
8 / 10calls agreed with the computed answer in one recorded session

What play-testing showed

Slow is invisible.

The first deployment used a larger model. A new board took more than a minute and still hadn’t arrived; the only answer that came back was the fixed help text. There was nothing to watch.

→ Switched the performer to Haiku at low effort: faster turns, and mistakes started showing up right away.
Memory froze a mistake.

Every answer was cached so the game would behave like real pure functions. When the performer wrongly refused a move (“r1c2 is a given and cannot be changed”), the cache handed the same refusal to everyone who reached that board, and the game stalled on that move.

→ On the web, only the opening board is remembered now. Everything else is asked fresh, so trying again can give a different answer.
Waiting is the medium.

Each call takes seconds. With a locked page, those seconds felt like a broken game.

→ The model’s summarized thinking and its half-written answer stream in; moves queue up so play never stops.
The board shows the model’s verdict.

Checking every answer against arithmetic was less interesting than letting the model’s claims play out on the board.

→ The board lights green or red based on what the model says, even when it names the wrong cells. Arithmetic’s opinion stays on the wall text.

Insight

The type of every answer is guaranteed. The value is not.

Theory of change

Ifevery function body is only its description,
Theneach answer keeps its shape but loses its guarantee,
So thatmistakes land on a grid anyone can check in a second,
Leading toa felt sense of what it means for a model to perform a rule rather than compute it.

Assumes: mistakes come often enough to be seen, but rarely enough that the game stays playable.

“Shouldn’t our expectations include the same command giving different results when it runs more than once?”

Turning point in play-testing

Designing for the wait

A performed function is slow, and the delay can’t be engineered away. So I asked for the wait itself to become part of the show. Claude Code proposed the mechanics below; I kept them, and cut a rendering panel after playing with it:

  1. Pencil marks.The digit you asked for appears small and ochre in its cell until the performer answers.
  2. Moves queue instead of locking.Keep placing digits; each move waits its turn because it needs the state the last one returned.
  3. Thinking, live.The summarized reasoning and the half-written JSON answer stream into the right column.
  4. A board being written.When a whole board is coming back, it fills in cell by cell as the answer arrives.
03

How I Worked with AI

AI is in this project twice. Claude Haiku is the performer inside the piece. Claude Code was my collaborator in building it: it wrote most of the code and proposed options, and I made the calls on what the piece should feel like by playing it.

At a glance

Dots show how much of each part Claude Code did.

ConceptMine
Function descriptionsDrafted together, tested against the code
Code & testsWritten by Claude Code, directed and reviewed by me
Interaction decisionsMade by me while play-testing
DeploymentDone by Claude Code; I held the API key

Before & after

What gets remembered
First designCache every answer by function and arguments, so the same question always gets the same answer, like a real pure function.
What I choseRemember only each seed’s opening board. Ask everything else fresh.

Claude Code offered two fixes: keep the cache and add a retry button, or cache only the opening. I chose the second, because a pure function may roll dice inside it. (A retry link, “ask again”, was added later anyway.)

Showing a conflict
First versionA red flash on the cells the performer names and a lighter one on their row, column or box, fading after about two seconds.
MineThe row, column or box it names lights faintly; the clashing digits light strongly, and stay lit until the next move.

The flash was gone before you could read it. A highlight that stays shows what the performer is accusing.

From the conversation

Me
It doesn’t feel like much of a show? And I haven’t run into any hallucinations?
Claude Code
You’re right, there’s no show yet. The performance hasn’t really started; it’s not that Claude is doing too well. Only one call has actually finished. … One option: switch the model to Haiku. It’s faster and cheaper, and you’ll see a lot more ✗.
The piece needs a performer fast enough, and fallible enough, to watch.
Me
… Switch the config to Haiku.
Me
This one got cached so the game can’t continue. Shouldn’t our expectations include the same command giving different results when it runs more than once?
Me
No. The core is to use Sudoku to show hallucination in a way that’s fun, and a pure function can have randomness inside it. So option 2 [cache only the opening].
The decision that defined the piece. Purity gave way to the show.
Me
I see you used a shake? It’s not very visible. When this 9 is first reported as a conflict, light the row faintly, then light this 9 and the other 9.
04

Reflection

Making a model wrong on purpose took more design than making it right. I picked the model, its effort level and the caching rule so that mistakes would happen often, show up on the board, and not end the game.

The shell is the frame: the only code that stayed real is the loop that reads your click and draws what comes back, and it decides what a visitor can see. Most of my decisions ended up there.

Keep reading

Asked to invent a brand-new puzzle from seed 2026, the performer handed back the example puzzle from Wikipedia’s Sudoku article, plus ten digits of its own. Two of them clash.

Observed on the wall text