4. WFC for Text

A 1D WFC where the tiles are syllables, words, and sentence fragments -- and adjacency encodes linguistic structure.

Interactive

Place names, tavern signs, prophecies

This is a 1D sequence WFC where tiles are linguistic units — syllables, words, or phrases — and adjacency rules encode how they can connect.

Place names — phonetic adjacency

Tiles are syllables like “gor”, “tha”, “el”, “mir”. Each syllable is tagged by its starting and ending sound type (vowel or consonant). The adjacency rule is simple: vowel-ending syllables connect to consonant-starting ones, and vice versa. This creates a natural CVCVC alternation that makes generated names feel pronounceable and plausible.

Tavern signs — part-of-speech grammar

Tiles are words tagged with parts of speech (article, adjective, noun, conjunction). Adjacency follows grammar rules: articles lead to adjectives or nouns; adjectives lead to nouns; nouns can end the phrase or connect via conjunctions. WFC generates valid grammatical structures like “The [Adj] [Noun]” or “[Noun] & [Noun]”.

Prophecies — narrative structure

Tiles are sentence fragments tagged by narrative role: opening (“When the”), subject (“last king”), verb (“rises again”), connector (“then shall”), object (“the ancient seal”), closer (“be undone”). Adjacency enforces story structure — openings lead to subjects, subjects to verbs, and so on. Each generation produces a syntactically complete prophecy.

The key insight

WFC doesn't “understand” language. It knows nothing about meaning, grammar, or phonetics. It simply satisfies local adjacency constraints between neighbouring tiles — and when those constraints encode linguistic rules, the output resembles coherent language. This is the power of constraint propagation: global structure emerges from local rules.