Speedysnail

Which Way Do Ya Wanta Go?

Last week I had an unexpected urge to revisit some of my earliest programming efforts. Unfortunately, they’re stored on ancient 5¼" floppies which would probably be unreadable, even if I had a 5¼" drive and a way of converting it to USB. Fortunately, at the time I wrote them I also printed out my collection of Apple II and BBC Micro BASIC programs using our school’s dot-matrix printers, and after rummaging through some old boxes was able to find those printouts again.

Turning pages of printouts back into readable code was a bit fiddlier than I’d hoped. You might imagine that OCR software would be able to handle dot-matrix characters, but you’d be wrong. My work-around was a bit of a hack, but did the job. (Skip the next paragraph or two if you like, they’re so I can remember what I did.) I scanned the pages at 300 dpi, then adjusted the levels in Photoshop to drop down the peak of the highlights to get rid of background noise and raise the midtones to darken the text. Next, I selected for the Color Range of the characters at Fuzziness 200%, expanded the selection by a single pixel, filled the selection with black to give less-dotty letters, selected the inverse, and then filled the inverse with white. I erased any leftover paper noise, then cropped down to the text, leaving out the line numbers of the code (which are handled oddly by PDF OCR X), and saved the results as a JPEG. The first program took about a dozen scans.

PDF OCR X converted these JPEGs into reasonably readable text, but the results still needed a lot of cross-checking against the original. After it was all clean, I added the line numbers back in (my favourite text-editor BBEdit has a handy tool for this), and the code was ready to go.

There are several different Apple II emulators available online, but the easiest for my purposes is Joshua Bell’s Applesoft BASIC in Javascript, which can’t handle the PEEKs and POKEs of more complicated vintage software, but can cope with a 336-line text adventure coded by a fourteen-year-old in his spare time after school. I loaded in the file, hit Run, fixed some of the OCR errors that trying to run the scanned code threw up, hit Run again, took out the NEW commands that Bell’s page couldn’t handle, and hit Run again.

And was transported back thirty-four years to our high school computer lab.

BULLAMAKANKA Welcome Screen

Bullamakanka is an Australian name for a mythical town out in the back of beyond, and also the name of a bush band who had a hit in 1982 with “Home Among the Gumtrees”, which must have been where I got it from. My first text adventure would have been inspired by memories of a family trip through the red centre in 1979, Ken Maynard’s cartoons of the Ettamogah Pub, and the general hard-drinkin’, car-lovin’ culture of Australia in the early 1980s. Its jokes appeal to a fourteen-year-old sensibility, but also made my wife and young kids laugh when I showed them the game (my son wants it as an app for his iPod Touch—sorry, mate), so that’s mission accomplished as far as I’m concerned.

In doing all of this I found a 34-year-old bug: typing any key other than the core directions sent you in the direction you’d typed last turn, except at the start, when it would trigger a crash. This also meant that the lovingly typed insults you were supposed to see after typing the wrong key were never revealed. So I’ve tweaked the code a little (removing a you’re/your typo while I was at it, but leaving “wierd”, which reminds me of being 14 and not knowing how to spell it). Now you, too, can be called a “DOOJI!!” for typing V or M or X, short for “doojiwobber”, the insult du jour in Grade 9 at Huonville High in 1982.

Click to see the KANKA code

If you’d like to play Bullamakanka, open up the source code in another window or tab, select and copy it all, then visit the Applesoft BASIC emulator, paste the code into the relevant window (overwriting the example line there), and hit Run.

As in many early text adventures, it was far too easy to die while playing Bullamakanka. Building up points protected you against this to some extent, but it was hard to get them in the first place. You can cheat by going north from the main square to visit the Gypsy Rose to get your fortune read, N then Y then S, over and over again, gaining 25 points each time, which will give you a better shot at surviving the Angry Drunk, the Police, “Ace” Freeway, and the Savage Man-Eating Wombat.

I’m not sure I’ll scan my next game, ADVENTRE, inspired by the fantasy text adventure that started it all. Even though it does offer a tantalising encounter with the Grand Dooji of Wobber, it’s a bit too close to the standard D&D-style games of the day to bother. My other Apple II games relied more on system graphics, and wouldn’t play nicely with Bell’s emulator, but the BBC programs from the following year might have potential. We’ll see.

5 April 2016 · Memory