Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

2026 Participants: Martin Bartelmus * David M. Berry * Alan Blackwell * Gregory Bringman * David Cao * Claire Carroll * Sean Cho Ayres * Hunmin Choi * Jongchan Choi * Lyr Colin * Dan Cox * Christina Cuneo * Orla Delaney * Adrian Demleitner * Pierre Depaz * Mehulkumar Desai * Ranjodh Singh Dhaliwal * Koundinya Dhulipalla * Kevin Driscoll * Iain Emsley * Michael Falk * Leonardo Flores * Jordan Freitas * Aide Violeta Fuentes Barron * Erika Fülöp * Tiffany Fung * Sarah Groff Hennigh-Palermo * Gregor Große-Bölting * Dennis Jerz * Joey Jones * Titaÿna Kauffmann * Haley Kinsler * Todd Millstein * Charu Maithani * Judy Malloy * Eon Meridian * Luis Navarro * Collier Nogues * Stefano Penge * Marta Perez-Campos * Arpita Rathod * Abby Rinaldi * Ari Schlesinger * Carly Schnitzler * Arthur Schwarz * Haerin Shin * Jongbeen Song * Harlin/Hayley Steele * Daniel Temkin * Zach Whalen * Zijian Xia * Waliya Yohanna * Zachary Mann
CCSWG 2026 is coordinated by Lyr Colin-Pacheco (USC), Jeremy Douglass (UCSB), and Mark C. Marino (USC). Sponsored by the Humanities and Critical Code Studies Lab (USC), the Transcriptions Lab (UCSB), and the Digital Arts and Humanities Commons (UCSB).

POET: A BASIC Poetry Generator

edited January 25 in 2026 Code Critiques

In July 1973 DEC published 101 BASIC Computer Games, edited by David H. Ahl: the Wikipedia article has more about how this book was the basis for a famous collection of microcomputer BASIC programs. I’ve never found even a scan of the first or second printing of the book. The third printing from March 1975 is the one I own and is available for browsing or download as an e-book at the Internet Archive.

On pp. 169–171 there are two programs, POETRY and POET, that particularly fascinate me. I’ll focus here on the shorter one, POET, found on p. 171. Here is a transcription of the program as it was presented on that page:

90 RANDOMIZE
100 IF I<>1 THEN 101 ELSE PRINT "MIDNIGHT DREARY";
101 IF I<>2 THEN 102 ELSE PRINT "FIREY EYES";
102 IF I<>3 THEN 103 ELSE PRINT "BIRD OR FIEND";
103 IF I<>4 THEN 104 ELSE PRINT "THING OF EVIL";
104 IF I<>5 THEN 210 ELSE PRINT "PROPHET";
105 GOTO 210
110 IF I<>1 THEN 111 ELSE PRINT "BEGUILING ME";
111 IF I<>2 THEN 112 ELSE PRINT "THRILLED ME";
112 IF I<>3 THEN 113 ELSE PRINT "STILL SITTING..."\GOTO 212
113 IF I<>4 THEN 114 ELSE PRINT "BURNED. "\GOTO 212
114 IF I<>5 THEN 210 ELSE PRINT "NEVER FLITTING";
115 GOTO 210
120 IF I<>1 THEN 121 ELSE IF U=0 THEN 210 ELSE PRINT "SIGN OF PARTING";
121 IF I<>2 THEN 122 ELSE PRINT "AND MY SOUL";
122 IF I<>3 THEN 123 ELSE PRINT "DARKNESS THERE";
123 IF I<>4 THEN 124 ELSE PRINT "SHALL BE LIFTED";
124 IF I<>5 THEN 210 ELSE PRINT "QUOTH THE RAVEN";
125 GOTO 210
130 IF I<>1 THEN 131 ELSE PRINT "NOTHING MORE";
131 IF I<>2 THEN 132 ELSE PRINT "YET AGAIN";
132 IF I<>3 THEN 133 ELSE PRINT "SLOWLY CREEPING";
133 IF I<>4 THEN 134 ELSE PRINT "...NEVERMORE";
134 IF I<>5 THEN 210 ELSE PRINT "EVERMORE.";
210 IF U=0 THEN 212 ELSE IF RND>.19 THEN 212 ELSE PRINT ",";\U=2
212 IF RND>.65 THEN 214 ELSE PRINT " ";\U=U+1\GOTO 215
214 PRINT\U=0
215 I=INT(5*RND+1)
220 J=J+1\K=K+1
230 IF U>0 THEN 240 ELSE IF INT(J/2)<>J/2 THEN 240 ELSE PRINT " ";
240 ON J GOTO 100,110,120,130,250
250 J=0\PRINT\IF K>20 THEN 270 ELSE GOTO 215
270 PRINT\U=0\K=0\GOTO 110
999 END

I found two transcriptions of the program online (one from the book, one from a collection of BASIC programs that was digitally distributed) and compared them to develop this one, which I hope is character-for-character accurate.

You can see an image of the the code and sample output on the Internet Archive. It’s on the recto of that page spread.

The transcribed code of POET will not run on any contemporary BASIC interpreter I’ve found, even RetroBASIC, which is being developed to run the programs in 101 BASIC Computer Games among other BASIC programs. (The RetroBASIC developer provided one of two versions of the transcribed code.) Please let me know if I’m mistaken about RetroBASIC or if you find another native BASIC interpreter that will work.

Given this, I decided to port the program to Yabasic, which runs very nicely on Linux and is supposed to run on Macs as well.

10 REM This is POET from Ahl, David H., ed., 101 BASIC Computer Games,
20 REM 3rd printing., Digital Equipment Corporattion, 1975, p. 171
30 REM Ported to Yabasic by Nick Montfort, 2026-01-11
40 REM See https://github.com/maurymarkowitz/101-BASIC-Computer-Games/blob/main/poet.bas
50 REM As well as Bertram, Lillian-Yvonne and Nick Montfort, eds.,
60 REM Output: An Anthology of Computer-Generated Text, 1953-2023,
70 REM MIT Press, 2024, pp. 157-158
80 REM --
90 I=INT(5*RAN()+1) : U=0 : J=0 : K=0
100 IF I==1 PRINT "MIDNIGHT DREARY";
101 IF I==2 PRINT "FIERY EYES";
102 IF I==3 PRINT "BIRD OR FIEND";
103 IF I==4 PRINT "THING OF EVIL";
104 IF I==5 PRINT "PROPHET";
105 GOTO 210
110 IF I==1 PRINT "BEGUILING ME";
111 IF I==2 PRINT "THRILLED ME";
112 IF I==3 PRINT "STILL SITTING..." : GOTO 212
113 IF I==4 PRINT "BURNED. " : GOTO 212
114 IF I==5 PRINT "NEVER FLITTING";
115 GOTO 210
120 IF I==1 THEN IF U==0 THEN GOTO 210 ELSE PRINT "SIGN OF PARTING"; FI : FI
121 IF I==2 PRINT "AND MY SOUL";
122 IF I==3 PRINT "DARKNESS THERE";
123 IF I==4 PRINT "SHALL BE LIFTED";
124 IF I==5 PRINT "QUOTH THE RAVEN";
125 GOTO 210
130 IF I==1 PRINT "NOTHING MORE";
131 IF I==2 PRINT "YET AGAIN";
132 IF I==3 PRINT "SLOWLY CREEPING";
133 IF I==4 PRINT "...NEVERMORE";
134 IF I==5 PRINT "EVERMORE.";
210 IF (U>0 AND RAN()<.19) PRINT ","; : U=2
212 IF RAN()<.65 PRINT " "; : U=U+1 : GOTO 215
214 PRINT : U=0
215 I=INT(5*RAN()+1)
220 J=J+1 : K=K+1
230 IF (U==0 AND INT(J/2)==J/2) PRINT " ";
240 ON J GOTO 100, 110, 120, 130, 250
250 J=0 : PRINT : IF K<20 GOTO 215
270 PRINT : U=0 : K=0 : GOTO 110
999 END

Relationship to Poetry and Poetic Practices

The program of course has bits of Poe’s “The Raven” as a source text, but also uses a technique that relates to a traditional one, the cento, and an avant-garde one, the cut-up method.

Invitation to Modify the Code

On p. 169 of the book programmers are explicitly invited to modify POET and use different textual sources: “Try it with phrases from computer technology, from love and romance, from four-year-old children, or from some other subject. Send us the output[.]”

Games are Not All Games

Despite the book being called 101 BASIC Computer Games, many of the programs — including POET — were not games in the standard sense. They were instances of “recreational computing.” Perhaps we still don’t have a good term for this category?

“Original” Code and Author Unknown

POET: “Original author unknown. Modified and reworked by Jim Bailey, Peggy Ewing, and Dave Ahl of DIGITAL.” p. 169.

Porting and Textual Editing of Code

I developed this port in about an hour and hope (but am not sure) that it functions just as the earlier program did.

One change I made, consistent with an editorial decision Lillian-Yvonne and I made in Output, was correcting the spelling of the word “fiery.” Many sorts of texts have typos and misspellings that should be corrected in a reading edition. We didn’t think maintaining the incorrect spelling was important to the vernacular nature of this program.

I also made many changes to the specifics of how the code functions. For instance, inequalities have been changed to equalities when testing different cases. I did this, in part, to maintain a 1-to-1 correspondence between the original lines (and their numbers) and the lines of the ported program. As with the translation of metrical verse, something must be given priority. In this case, not sound or sense, but the control flow or the “lineation” of the program.

I’m eager to hear comments on POET itself and on the work I’ve done to share it here. Also, try it with your own modifications and post the results!

Comments

  • Here’s a modification — I hope some of you have read the wonderful source text:

    100 IF I==1 PRINT "halfway tree";
    101 IF I==2 PRINT "there at midnight";
    102 IF I==3 PRINT "ramshackle state";
    103 IF I==4 PRINT "bitter! barren!";
    104 IF I==5 PRINT "it make me frighten";
    105 GOTO 210
    110 IF I==1 PRINT "my mind";
    111 IF I==2 PRINT "I reach down there";
    112 IF I==3 PRINT "how to tell" : GOTO 212
    113 IF I==4 PRINT "I found" : GOTO 212
    114 IF I==5 PRINT "must and bound";
    115 GOTO 210
    120 IF I==1 THEN IF U==0 THEN GOTO 210 ELSE PRINT "contrary"; FI : FI
    121 IF I==2 PRINT "mixed up";
    122 IF I==3 PRINT "from the straight path";
    123 IF I==4 PRINT "divded";
    124 IF I==5 PRINT "is hard";
    125 GOTO 210
    130 IF I==1 PRINT "panic that did pitch";
    131 IF I==2 PRINT "my heart’s core";
    132 IF I==3 PRINT "attack me";
    133 IF I==4 PRINT "sun beams sent";
    134 IF I==5 PRINT "the mountain";

    bitter! barren!
      I reach down there is hard attack me
    there at midnight
      I found

    from the straight path
      sun beams sent

    I reach down there ramshackle state
      must and bound mixed up panic that did pitch
    halfway tree must and bound, contrary sun beams sent,

    it make me frighten
      how to tell

    from the straight path sun beams sent
    it make me frighten, I found
     contrary,
      my heart’s core

  • edited January 25

    @nickm Ah! Very good! One of the experiments I did with my son, and now teach standard when I teach high school classes on AI, is to train a Markov Model on The Raven:

    https://leosstemhacks.wordpress.com/2018/08/22/raven-redux/

    And in case anyone cares (which you actually shouldn't) here're the slides I use when I teach AI to high schoolers:

    https://docs.google.com/presentation/d/1EmMDl-1RhTm6L8YYBvrygb1dio6hG3Znbv4hE_0mh_g/edit?usp=sharing

    ps. David Ahl produced many followup volumes of these popular books. He tells me that they were the best selling computer books of their era (I don't recall whether he gave me a date range for that claim).

    You're right that they contained much more than games, for example, check out pg. 20 of this 1984 edition (reproduced below for your convenience). There was a previous CCS reading workshop on this version of ELIZA. (I know that you know this Nick. Others might not, and might be interested in going back to look at it.)

    (BTW, the header is incorrect. ELIZA wasn't originally written in Lisp -- long story for another time.)

    https://mirrors.apple2.org.za/ftp.apple.asimov.net/documentation/programming/basic/Big Computer Games.pdf

  • Super interesting and to help with code annotation, I've set up a project here:

    POET - code annotation of the CCS workbench

Sign In or Register to comment.