Yesterday I downloaded Chipmunk Basic and installed it on my laptop. I did code up a quick sieve of Eratosthenes with lots of comments and helpful PRINT statements, all without cheating and looking at the sieve program included in the readme. I guess I get a gold nerd for that. Anyway, this morning I told the Badb that if she did the programming — not me, mind, but she, herself — then I was perfectly okay with her using programs to do her homework. In two seconds she went from glazed and bored to hyperalert. I took her through the code and showed her how the program worked and I could see her starting to lose focus again. I’m trying to remember all the fooling around with programs I did as a kid before I was competent enough to write programs to cheat at doing homework.
We used to have a subscription to Byte magazine; some months there’d be a printed listing of a BASIC program and my dad would have me sit at the computer and type the listing in. The programs that I remember were games, some more interesting than others. One that I spent most time on was a sort of Zork imitation. There was just a text interface, of course, with the prompt being a printed description of the room your character stood in. You explored the maze, and I don’t remember if there was even a victory condition. Maybe you had to find an object and then bring it back out; I don’t remember. The thing that impresses me now is that the program was so long and complex that even though I knew that I was typing in a puzzle as I typed in the program, I didn’t know how to solve it. But I did see how to change the game — of course, the source was right there in front of me. First, I started by rewriting the descriptions of rooms. Then I figured out how to add a room and hook it in to the existing rooms. That took some doing, since the map was just a bunch of lines of DAT statements with line numbers as the data. Altering the program altered line numbers and wound up invalidating the lookup table. I think I must have spent several months fooling around with these programs before I ever undertook writing anything more complicated than, “Hello, world!” But all that fooling around taught me lots about the BASIC programming language, about how programs are structured, about the kinds of tricks you can do when you’re actually writing the software. Hmm. Maybe I’ll start out with a game that plays Hangman. Or tic-tac-toe. Or nim.
So now I wonder, having found an archive of scanned magazines, is this something my kid would be interested in? Can it really compete with web sites that let her dress up Barbie? Man, I sure hope so! I want her to think, if she’s unhappy with the array of accessories, “I know! I’ll write my own version that has the kind of bracelets I want!”