Villagers on a hand-drawn island invent words and talk their way into dialects.
Nobody on this island starts with a word for anything. Thousands of times a second a random villager turns to a neighbor it can see, since mountains and water block the view, and names a berry, a fish or a flower. This is the minimal naming game: a speaker with no word invents one, otherwise it says a word it knows; if the hearer knows that word too, both forget every rival, and if not, the hearer learns it. Local agreement snaps into place in seconds, then dialect regions grow and their borders straighten like domains in a magnet, while the ridge down the middle keeps the two coasts apart until a road lets messengers carry words across. The map is a coarse nearest-villager grid upscaled into a watercolor wash with dotted borders, laid over parchment, a coast traced by marching squares and ink mountains drawn in code.
Try it. Drag to raise a mountain range and split a population. Shift-drag (or right-drag) to build a road that messengers walk along. Click the view, then press 1, 2 or 3 to map the words for berry, fish or flower, R to make everyone forget their words, C to clear your mountains and roads, plus and minus for speed and Space to pause.
Paste this into Claude Code, Codex or any coding agent to get a simple version running, then take it wherever you like.
Build the naming game, a model of how a shared vocabulary emerges from local conversations, with JavaScript and the HTML canvas element. Put everything in a single index.html file with no libraries or build step, so I can open it directly in a browser.
Start simple:
- Scatter about 300 agents at random positions on a canvas that fills the window. Give each agent an empty list of words for a single object.
- Precompute each agent's neighbors: every other agent within about 60 pixels.
- Run a few thousand conversations per second. In each one, pick a random speaker and a random neighbor as the hearer. If the speaker has no words, it invents a random pronounceable word (alternate consonants and vowels). Otherwise it picks one of its words at random.
- If the hearer already knows that word, the conversation succeeds and both agents drop every other word. If not, the hearer adds the word to its list.
- Give every new word a random color and draw each agent as a dot in the color of its most recent word, paler if it still knows several.
Once that works, make it beautiful:
- Paint a parchment background and color the land under each agent with a soft wash of its word's color by filling a coarse grid by nearest agent and scaling it up with smoothing.
- Show a few conversations as speech bubbles with the spoken word, plus a check mark or question mark from the hearer.
- Let me drag to draw a wall that blocks conversations between agents on either side, and watch separate dialects form.
Explain the key ideas in short code comments. When you're done, tell me how to open it and suggest three directions I could take it next, such as several objects with their own borders, roads that carry words far away, or plotting the number of distinct words over time.