Seventeen semicircles, laid down in one fixed order, that coil into a maze with a single path.
Not a maze
A maze has choices. A labyrinth has none: one path, no branches, no dead ends,
winding as far as possible before arriving. The design drawn here is one of the
oldest known — it appears on Babylonian clay tablets, scratched next to
liver-divination diagrams, which is where the “visceral” in its name comes from. It
looks like a coil of intestines because that is roughly what it was drawn beside.
What is drawn is not the path. It is the walls, and the path is the gap between
them. That is why the finished picture reads as a solid tangle rather than as a
route: the route is the negative space.
A plotter script
There is no algorithm here in the usual sense. There is a turtle, and a fixed
sequence of instructions:
t.PenDown();
t.Circle(Scale * 8, -180);
t.Circle(Scale * 7, -180);
t.Circle(Scale * 6, -180);
t.Circle(Scale * 2, -180);
Every arc is a semicircle — always ±180 degrees, never anything else — with a
radius that is a whole multiple of Scale. The whole design is seventeen of them,
and the radii used are 1, 2, 3, 4, 5, 6, 7 and 8. That constraint is not the
programmer’s; it is the tablet’s. A design built from half-circles on a fixed grid
can be laid out with a compass and a straight edge, and it survives being copied by
hand.
Four arcs in. The radii step down — eight, seven, six, two — and each semicircle
hands its endpoint and heading to the next, so the coil turns inward without any
coordinate ever being written down.
The turtle
Fifty lines of state machine, and only three pieces of it:
private float _heading;
private bool _penDown;
private SKPoint _pos = new(0, 0);
Circle(radius, extent) finds the centre perpendicular to the current heading,
draws the arc if the pen is down, then advances both position and heading to the
far end of it. Because heading accumulates, Circle(r, -180) followed by
Circle(r', -180) produces two arcs that meet tangentially — the join is smooth by
construction, and never by calculation.
Seven arcs, and the pen lifts for the first time. What has been drawn is one
continuous run; the lift is how the script gets to the start of the next one without
leaving a line behind it.
Runs and lifts
The script alternates. A run of arcs with the pen down, then PenUp, a
SetHeading and a Forward to reposition, then PenDown and the next run. Six
runs in all, and the lifts between them are what make the walls discontinuous —
which is exactly what a labyrinth needs, because a wall that closed on itself would
seal the path.
The second run, climbing back out through radii 3, 1, 5, 6, 7. It mirrors the first
run rather than continuing it, and the space between the two is the path.
Four short arcs — radii 2, 1, 3 and 1 — dropped into the gaps the two long runs
left. Each is preceded by a lift and a Forward of one or six or seven units,
positioning the pen by counting rather than by measuring.
The last arc
One semicircle of radius 4 × Scale, and the design closes.
This last arc is the only one whose heading is a parameter rather than a literal:
t.SetHeading(ClosingAngle);
t.Circle(Scale * 4, 180);
ClosingAngle is 225 or 270 across the renderings, which rotates the final wall
by 45 degrees and changes which edge of the labyrinth becomes the mouth. It is one
of several structural levers now — the renderings also vary in scale, stroke,
rotation, echo layers and per-arc ink.
Seven renderings
| Rendering | Scale | Closing angle | Stroke | Structure |
|---|
| Pink Labyrinth | 40 | 225° | 1.5px | a 0.60× echo of itself in deep magenta |
| Ice Spiral | 45 | 270° | 1.2px | single pass, largest scale, finest stroke |
| Orange Maze | 35 | 225° | 2.0px | single pass, smallest scale, heaviest stroke |
| Tablet | 42 | 270° | 2.2px | umber on clay, on a museum mat |
| Divination | 38 | 270° | 1.6px | ink ramp across the arcs, canvas tilted 45° |
| Entrails | 40 | 225° | 1.6px | the design at 1.45×, 1× and 0.62× at once |
| Twinned | 34 | 270° | 2.0px | a second pass, upside down, beneath the first |
Scale multiplies every radius and every Forward, so it is a true zoom: the
design is identical, drawn larger or smaller in the same 800-pixel frame. Ice Spiral
is both the largest and the most finely drawn, which is why it reads as a diagram
and the orange one reads as a rope.
The other four renderings push the structure further than the zoom allows. Echo
layers draw whole copies of the script beneath the main pass — at other scales for
the nested designs, or rotated 180° for the interlocked double-exposure — and the
ink ramp recolours the main pass arc by arc, in drawing order, from midnight indigo
through violet to rose. None of it samples anything: every layer, angle and colour
is a fixed literal, so the renderings stay exactly reproducible.
Determinism
There is nothing to seed. The script is a literal sequence of calls; every radius is
an integer times Scale and every arc extent is exactly ±180. The only floating-point
work is one sine and one cosine per move, and the same script produces the same
picture on any machine.
Origin
Translated from the Turtletoy sketch
Babylonian Visceral Labyrinth, MIT
licensed, whose own notes cite the blogmymaze articles on the tablet designs.