10 PRINT CHR$(205.5+RND(1)); : GOTO 10

“10 PRINT CHR$(205.5+RND(1)); : GOTO 10″ is a BASIC program that will run on all Commodore 8-bit computers including, most famously, the Commodore 64.

It’s also the title of a book released in 2012 that can be purchased in hard copy, or downloaded for free from the official website: 10print.org

I got a copy of the book for Christmas 2013, and thoroughly enjoyed reading it. It’s a terribly close reading of the titular one-line program; that program, when run on the C-64, creates an infinitely scrolling maze pattern. The output seems too involved and interesting to be the product of such a tiny, cryptic program. The book discusses every facet of the program and connecting fields of study, such as mazes and randomness. I found the section on computational randomness in the arts especially inspirational.

So inspirational, that when my online song-writing group decided to collectively write a concept album based upon Shakespeare’s Sonnet 64, and I ended up with line 10, “Or state itself confounded to decay”, I used an old Amiga program called NIALL to generate the lyrics for the song. I dumped Sonnet 64 and some Wikipedia commentary into NIALL, and then NIALL used its simple Markov-chain-like procedure to generate new sentences based on the input I gave it. I edited the output a bit, to make it somewhat more lyrical.

We had an additional constraint in the song-writing process: we had to use the common ii-V-I chord progression for at least some of the song. I spent a couple short sessions working on the music, doing my best to write a more interesting melody than most of songs to date. My eldest daughter and I then recorded the song in my basement home studio, using a slightly modified preset on my Zoom MS-50G pedal (a wah filter driven by a step sequencer) as the main bed track that we built the song on. After several poor attempts at singing the vocals myself, my daughter took over the lead vocal, and did a great job. We added some gradually increasing distortion to the vocals to add to the decay or corruption theme of our key lyric.

The video footage was all filmed with my iPod 5g, recording the 1702 monitor hooked up to my Commodore 64, running a couple 6502 programs I wrote specifically for this purpose. One is a 6502 port of _10 PRINT_ with the addition of smooth scrolling. I wanted the visuals to seem like an infinite maze world passing by under the viewer.

The other program increments every character on the screen, so an ‘A’ will become a ‘B’, and so on. It does so in a pattern determined by a 10-bit LFSR that I wrote in BASIC for this forum 7 years ago, and ported to 6502 for this purpose; it allows the screen to be changed in a seemingly random order, but still guarantees that all 1000 locations on the screen will be changed in linear time. I added a delay loop whose length is controlled by a paddle controller, so I could make the effect run faster or slower while it was running. I also created a “corrupted” version of the same program that would periodically skip incrementing locations, to cause the effect to run less uniformly.

I’m still skimming over many details, but that’s probably sufficiently detailed to satisfy the curiosity of the one person who was interested. So, here’s the video:

In a future blog post, I want to talk about _10 PRINT_ more. Specifically, despite the book’s awesomeness, page 229 has, by my count, five errors. I’ve been looking for any discussion of this online, but surprisingly, have come up with nothing so far, and my feeble attempts to contact some of the book’s authors haven’t got anywhere. So, I should blog about it.

2 Responses to “10 PRINT CHR$(205.5+RND(1)); : GOTO 10”

  1. Darren Says:

    Thanks for the details and insights, but I’m not sufficiently satisfied yet. :)

  2. Tim Says:

    I think at least two people are interested. :) I love this reflective writing about the creative process. Good idea to link it from Facebook. That draw it to my attention!

Leave a Reply