The Famous One-Line C64 Program, Now as SVG
In 1982, a single-line BASIC program on the Commodore 64 captured a generation's imagination:
10 PRINT CHR$(205.5 + RND(1)); : GOTO 10
It repeatedly printed CHR$(205) (a forward slash) or CHR$(206) (a backslash), randomly, until the screen filled with an oddly mesmerizing maze-like pattern. This generator reproduces the same algorithm as a scalable, stylable SVG you can drop into any modern design.
How It Works
A cols × rows grid is placed on the canvas. For each cell, a seeded random function picks either a / or \ diagonal, drawn as a single <line>. The result is a crisp SVG with just a handful of elements per pattern — easy to hand-edit, easy to animate, and ridiculously small in file size.
Controls
- Columns / Rows — how many cells in each direction.
- Cell size — how big each cell renders in pixels.
- Thickness — stroke width of each diagonal.
- Color / Background — two-color scheme.
- Seed + Re-roll — pin a layout you like, or re-roll for a fresh one.
Uses
- Retro / demoscene-inspired landing pages
- T-shirts and stickers for developer culture
- Album covers and zines
- Generative-art posters
- CSS
background-imagedecorations viadata:URI
Because the output is SVG with only <line> elements, you can easily swap in CSS variables for the colors, animate the stroke using stroke-dasharray, or turn the pattern into a tiled pattern via <pattern> if you want an endless background.
Tiny Online Tools







