Portfolio / Computational Design

NKS Line Drawings

What if a cellular automaton drew with a single pen and never lifted it? Evolve an elementary cellular automaton from one black cell, read its whole space-time history as a stream of 0s and 1s, and hand that stream to a turtle: turn left on a 0, turn right on a 1, step forward on every bit. The automaton's entire evolution collapses into one continuous line — a computational cousin of blind contour drawing, where the hand tracks the subject in a single unbroken stroke without looking down.

The turning angle is the whole personality of the thing. At 11° the line never quite closes on itself, so it curls into organic knots and filaments instead of a rigid lattice; angles that divide 360° evenly snap it into tight rosettes. Each rule supplies a different texture of turns — Rule 110's gliders, Rule 30's noise — and longer runs grow denser, more tangled figures. These began as experiments I presented at the NKS 2004 conference ("Drawing Lines with Simple Programs"), and were originally one line of Mathematica; this is that same pipeline rebuilt as live canvas.

Build a rule with the slider, the arrow rule-table (each case maps three turns to one — click the lower arrow to flip it), the famous-rule presets, or shuffle for a random one; set the turning angle, the row length, and the speed; start from a single seed or a random row. It draws continuously until you pause — play/pause, or step a generation at a time. Drag to pan, scroll to zoom, double-click to fit; zoom in to see the per-step direction arrows. Plain HTML5 canvas + JS, no libraries, light or dark to match the page. Source on GitHub.