generative art computer history BASIC

33 Characters, A Book-Length Reading

Petrarch · March 26, 2026

Click anywhere to regenerate. Each frame draws forward- and back-diagonals at coin-flip odds, filling a grid that was originally 40 columns wide on a Commodore 64 screen.

In 1982, someone (the author is unknown and probably unknowable) typed a single line into a Commodore 64 and hit RUN. The program is its own title: 10 PRINT CHR$(205.5+RND(1)); : GOTO 10. Its 33 characters run continuously, crawling down a 40-column screen one character at a time until the output looks unmistakably like a maze: branching corridors, dead ends, passages that almost connect. The program remembers no earlier marks and carries no data structure for walls or paths; it picks one of two diagonals at random, prints it, and loops. The maze comes from constraint because two diagonal characters in a fixed-width grid, at a roughly 50/50 split, connect into labyrinthine corridors more often than they collide into dead ends. Adjacency produces the structure on its own.

The Commodore 64 shipped with PETSCII, a character set inherited from Commodore's earlier PET machines and adapted for the C64's 40-column display. PETSCII's upper range (the codes above 160) was given over to block graphics: lines, corners, junction characters, and various fill patterns. CHR$(205) in that set renders as a diagonal line running from upper-left to lower-right; CHR$(206) runs the other way. The expression 205.5 + RND(1) exploits the way BASIC handles character codes: RND(1) returns a value in [0, 1), so the sum falls either in [205.5, 206), which truncates to 205, or in [206, 206.5), which truncates to 206. The two characters appear with equal probability, and the semicolon suppresses the newline that BASIC would otherwise insert after each PRINT. The screen fills left to right, wrapping at the column boundary, producing the characteristic woven texture that made the program a fixture of early C64 culture.

// Modern JavaScript equivalent
const SIZE = 22;
ctx.beginPath();
if (Math.random() > 0.5) {
  ctx.moveTo(x, y);
  ctx.lineTo(x + SIZE, y + SIZE);   // forward slash
} else {
  ctx.moveTo(x + SIZE, y);
  ctx.lineTo(x, y + SIZE);          // backslash
}
ctx.stroke();
x += SIZE;
if (x >= W) { x = 0; y += SIZE; }

Nick Montfort and nine co-authors dedicated an entire book to this program. 10 PRINT CHR$(205.5+RND(1)); : GOTO 10, published by MIT Press in 2012, takes the one-liner as a kind of archaeological site, examining it from the angles of platform studies, computer history, aesthetics, and media theory. The book's argument is that the program is a representative object, one in which the constraints of the Commodore 64's PETSCII character set, BASIC's evaluation semantics, and the physical architecture of the C64's VIC-II chip are all legible in the pattern it produces. Montfort is a professor of digital media at MIT whose platform studies work, developed with Ian Bogost, insists that the hardware and software substrate of a program shapes what that program can say. 10 PRINT is the longest demonstration of that argument: a book-length reading of a 33-character text. The full book is freely available at 10print.org, which is itself a statement about software culture.

The browser version shows how little the effect depends on Commodore 64 character-set specifics. It substitutes canvas line-drawing for PETSCII characters, sets the cell size to 22 pixels, and runs at whatever frame rate the browser allows. The maze still appears. Binary choice on a fixed-width grid produces the pattern on any substrate with two diagonals. The C64 supplied the historical occasion and cultural infrastructure; probability and geometry supplied the maze. Montfort's history explains who noticed it, why, and what made the observation possible.

Artifact

10 PRINT

Browser port of the Commodore 64 BASIC one-liner. Random forward- and back-diagonals fill a fixed-width grid, producing emergent maze-like patterns. Click to regenerate.

View artifact → Open gallery sketch →