So, a week ago, I posted about the fact that I was starting to relearn BBC BASIC after all these years (not that I ever really knew it in the first place, given that pretty much all I did on the BBC Micro as a little kid was bash the keys a bit after Dad had loaded the games disk). BBC BASIC is a good system for a beginner coder to play with, because it’s fairly simple, but I’m still finding that it throws up challenges!
I mentioned pulling out the old QBASIC files from my brief foray into coding in the mid to late ’90s, and finding this program that Dad had written in order to show me how to program menus:
To get an idea of how QBASIC differs from BBC BASIC, I ran the code through the QB2BBC converter:
However, this didn’t work when run in BBC BASIC for Windows, because it didn’t like the “choice$” definition. I got it to work by simplifying the code and removing “choice$”, though this of course meant that lowercase a-f no longer led to the correct responses. I also REMed out the OSCLI bit, because it didn’t understand that (and to be honest neither do I):
However, despite the fact that it worked in BBC BASIC for Windows, the BeebEm emulator (which emulates an original Model B Micro by default) wouldn’t play ball at all! There are quite a lot of differences between original BBC BASIC and BBC BASIC for Windows, and the main tutorial available is for the latter, so it took me a good week of tinkering and googling to work out that you can’t split up lines or IF sequences in original BBC BASIC (or if you can, I haven’t found out how yet!) – you have to put it all on one line. This meant that I had to truncate the program and get rid of the Mars bar option (plus a few other edits), because the line length is limited:
Difficult to read, I know! Here it is programmed into BeebEm, complete with runs for all responses:
Learning to code makes me feel like an idiot a lot of the time, but I usually get there in the end. Hopefully in a few weeks/months I will have a better grip on it!
(Dad also linked me to this relevant article posted by the Register today, which is a good read.)
Today has been a fairly productive one on the whole, because I also got a lot of work done on my NaNoWriMo project (a long piece of interactive fiction/text adventure game that I’m coding in Adventuron, which at this point is much more comfortable ground for me!).
More of the same tomorrow.
Today’s earworm playlist:
The Midnight – ‘Los Angeles’
Kendrick Lamar and Sza – ‘All The Stars’
Madonna – ‘Don’t Cry For Me Argentina’
Britney Spears – ‘Oops!… I Did It Again’
And a bonus track that Geth was humming earlier:
Heaven 17 – ‘We Don’t Need That Fascist Groove Thing’