Afterglowscreensavers

Wang Tile Self-Assembly Screensaver

Wang tiles are squares with a real color assigned to each of their four edges. This screensaver places them one at a time onto a grid, always picking a tile whose edge colors genuinely match its already-placed neighbors — building a real constrained mosaic purely through local edge-matching, with no global picture in mind.

Live preview

Wang Tile Self-Assembly screensaver — Edge-matched tiles, snapping together one by one.

Press ESC to leave fullscreen. Settings are saved in your browser only.

How the Wang Tile Self-Assembly screensaver works

Each tile in the real tile set has four independently colored edges: north, east, south and west.

Placement proceeds one cell at a time; a candidate tile is only accepted if its north/west/etc. edge colors genuinely match the already-placed neighboring tiles it touches.

Because only local edge constraints are checked — never a global plan — the final assembled mosaic is a real emergent structure rather than a pre-drawn image.

When no tile in the set can satisfy a cell's constraints, that region resets and retries with a new random tile choice, exactly like a real constraint-satisfaction backtrack.

Hao Wang's tiles and the question of aperiodicity

Wang tiles are named for the logician Hao Wang, who proposed them in 1961. Each tile is a square with a colour on each edge, tiles may not be rotated or reflected, and two tiles can sit side by side only where their touching edges match. Wang asked whether an algorithm can decide if a given finite set of such tiles covers the whole plane, a question about the limits of computation.

He conjectured that any set that tiles the plane can do so in a repeating pattern, which would have made the question decidable. His student Robert Berger disproved this in 1966 by reducing the halting problem to tiling, which showed the problem to be undecidable and implied that some tile sets can tile the plane only aperiodically. Berger's first set had 20,426 tiles, which he cut to 104 in his thesis. Karel Culik found a 13-tile set in 1996, and in 2015 Emmanuel Jeandel and Michael Rao found one with 11 tiles and 4 colours, the smallest known.

Wang tiles are also used in computer graphics to generate large non-repeating textures and other 2D data from a small set of edge-matched tiles. The tiling here is built by local choice and may need to retry when no tile fits, which is typical of constraint-satisfaction methods. What you see is one valid outcome among many, not a unique solution.

A worked example

Watch a colored edge on a freshly placed tile force its neighbor's choice — only tiles whose matching edge shares that exact color are eligible, so the pattern visibly builds outward from purely local, tile-to-tile agreements.

Settings & tips

Frequently asked questions

Are Wang tiles a real mathematical concept?
Yes — introduced by mathematician Hao Wang in 1961 to study whether a set of tiles can tile the plane, a problem later shown to be undecidable in general.
Does the placement ever fail?
If no tile fits a cell's constraints, that spot resets and tries again — a real, simple backtracking approach.
Is a key needed?
No — it's a pure local computation.
Is it free?
Yes — free, no download, in your browser.
Why does an undecidable tiling problem matter?
Berger showed that deciding whether a tile set covers the plane is equivalent in difficulty to the halting problem, so no single algorithm can answer it for every possible set of tiles.
What is the smallest known aperiodic Wang tile set?
Emmanuel Jeandel and Michael Rao found a set of 11 tiles with 4 colours in 2015. They also showed that no aperiodic set exists with 10 tiles or with 3 colours.
Where are Wang tiles used in real software?
They are used in procedural generation of textures and terrain, where a small set of edge-matched tiles fills a large area without an obvious repeating grid.

← All Generative screensavers