The 10-PRINT Commodore 64 one-liner generates complex maze-like patterns from a single coin-flip per character cell
The canonical 10-PRINT program (10 PRINT CHR$(205+INT(RND(1)));:GOTO 10) fills the screen by choosing between two diagonal characters (/ and ) at random for each cell position. Despite using only a single binary random decision and no spatial awareness, the resulting pattern reads as an intricate, maze-like texture with alternating open and closed regions. Its significance is pedagogical: it demonstrates that richly structured visual output can emerge from a minimal stochastic rule, and that the choice of symbol matters — swapping the characters changes the perceptual quality without changing the algorithm. It is the canonical ‘least code, most complexity’ example in creative coding.
Examples
BASIC: 10 PRINT CHR$(205+INT(RND(1)));:GOTO 10 — two diagonals, coin-flip per cell. Weighting the coin (e.g. tails 9× more likely) produces denser diagonal clusters.
Assessment
Implement the 10-PRINT pattern in p5.js or Hydra. Then modify the bias probability and describe how the visual texture changes. What probability produces the most ‘maze-like’ result?