QBasic, my first programming language
This post is a continuation of my history with computers, after learning hexadecimal to cheat at SimCity 2000.
GORILLA.BAS
In the ancient past, software occasionally included delightful hidden gems or "Easter eggs" (as opposed to the modern trend of hiding personal data exfiltration).
MS-DOS 5+ included two bonus games, if you knew how to find them:
- A Scorched Earth-like artillery game, GORILLA.BAS
- A snake game, NIBBLES.BAS
GORILLA.BAS (1991)
Both of these games targeted QBasic, a development environment for a dialect of BASIC that also came with MS-DOS. All you needed to do was run QBASIC.EXE, File -> Open one of the source files, and hit F5 to get started.
The fact that these games were distributed in source form made it obvious to even me, just a kid, that I might be able to create my own games in QBasic. That was all the motivation I needed.
QBasic
Getting started
I'm going to take a minute to marvel at the concept of learning a programming language without internet access. While some programming languages still include offline documentation that is sufficient for getting started, I can guarantee that, today, I would do at least one web search in the process of learning any new programming language. I'll even admit that sometimes I'm too lazy to figure out how to obtain offline documentation, and I just rely on online resources entirely (though I'm trying to stop doing that). Regardless, imagine firing up QBASIC.EXE as a brand new user and taking your first few programming steps without a single context switch or external resource. Ok, back to the story.
I started learning QBasic using the built-in documentation, but I eventually got my hands on this weighty tome:
Teach Yourself QBasic in 21 Days, by Namir C. Shammas (1993)
(I never finished the book, but I did make several earnest attempts.)
Before attempting a game, my first task was to automate my math homework. I remember creating simple programs that would multiply and divide numbers. As related at the end of this post, I miraculously managed to find a copy of a program that I wrote in January 1997. It was a program for factoring numbers. Here it is, presented in all its naive O(n2) glory:
start:
CLS
PRINT " ***Welcome to the Factor Finder (FF)!***"
PRINT ""
INPUT "What do you want to search for factors for? ", finfac
CLS
search:
maxnum = finfac + 1
FOR number = 1 TO maxnum
FOR bnumber = 1 TO maxnum
IF number * bnumber = finfac AND number <> 1 AND number <> finfac THEN
PRINT number;
GOTO searcha
END IF
NEXT bnumber
searcha:
NEXT number
LOCATE 23, 1
PRINT " DONE!!"
DO
LOOP WHILE INKEY$ = ""
Feel free to Ctrl+Insert, Shift+Insert that into QBasic to give it a spin. (Copy-paste shortcuts were different back then.)
"Advanced" topics
Initially, I only understood loops, conditionals, arithmetic, and basic input/output. I don't have a copy of it, but I made a quiz game at some point that just had a bunch of code duplicated over and over for each question.
One day, I remember telling my dad that I was trying to repeat an operation on a bunch of data, but that I couldn't figure out how many times to copy-paste (because the count, as I would describe it now, depended on user input). Luckily, my dad had done some programming in his past, so he suggested that I research "arrays". That ended up being exactly what I needed. Likely from a book, I also learned about subroutines. Arrays and subroutines finally enabled me to stop duplicating code.
Next, I entered the "starting huge projects I would never finish" phase of learning to program. Most of my efforts were directed at creating games, though the majority of my actual output consisted of creating cheats and secrets for not-even-half-finished games. Here's a sample of what my elite QBasic skills could produce: a text/character-based map that the player can move around in (complete with the "fog of war"):
Jared's RPG (unreleased, 1997)
I'm sure I had grand plans of creating a sprawling role-playing game, but simple movement is about as far as I got.
Finally finishing a game
Eventually, I noticed that I was biting off more than I could chew, so I decided to tackle a game that was small enough in scope that I could almost certainly complete it. Aside: this is a good life lesson about going for quick wins to build experience and momentum.
This venture happened to coincide with me buying my first personal computer (i.e. not shared with family). I managed to scoop up a 286 laptop with a faulty battery and no backlight for $15 at a surplus store. The screen on this laptop was truly terrible. If you've ever used an original Game Boy, with its severe ghosting, just blow that up to about 10 inches, and you'll be mostly there.
Anyway, I sat down and programmed an entire game in QBasic on this (literal) garbage laptop. It was a bombing game that I imaginatively titled Jared's Bombing Game.
Jared's Bombing Game (1997)
I thought about either embedding an emulator or porting the game to the web, but it's honestly so terrible and unplayable that I'm just going to leave it to your imagination. All you're trying to do is time dropping your bombs such that they hit the moving targets. But it's an actual finished game--my first, in fact! I was well on my way to achieving my kid dream of being a professional game developer!
Beyond QBasic
By this point, I had caught the programming bug. Instant gratification, by making the computer do the tedious work, was addictive.
At some point, I wanted to share my creations with others, but distributing QBasic source code was cumbersome. My goal was to be able to compile my very own .EXEs. Back then, pre-Internet, it wasn't easy to obtain a compiler, and most of them cost a lot of money. The closest I found (and could afford) for DOS was something called ZBasic, which came with a programming guide and had the ability to compile code into a self-contained .COM file (which I assume must have embedded their BASIC interpreter). The only program I specifically remember completing in ZBasic was one to clear the screen. Impressive stuff, I know!
After that, I got sidetracked by "mapping". Not in the cartographic sense, but creating maps for 3D shooters, like Doom, Quake, and, eventually, Half-Life. In that vein, the next language I attempted to learn was QuakeC, a limited dialect of C that was created for programming game logic in Quake. I suspect I'm one of only a handful of people whose first introduction to C was via QuakeC. But this post is about QBasic.
Buried treasure
Fast-forward to 2025, and I unearthed a cardboard box full of 3-1/2" floppy disks. One of them had a handwritten label that said "Jared.001 Qbasic". I had trouble getting the floppy to work at first, because my USB floppy drive could only read 1.44 MB "High Density" floppies. This was a 720 KB "Double Density" floppy! I had forgotten that those even existed (on "IBM-compatible" computers).
Luckily, I had preserved a 1997 Dell Latitude CP laptop with a floppy drive that could read the double density diskettes. Armed with this Pentium laptop and Windows 98, I was able to finally poke around on the disk. I found a bunch of terrible code that I had written almost 30 years prior, along with some English assignments, misspellings and all. The factor finder program, "RPG", and bombing game mentioned in this post all came from that one disk. There were even multiple in-progress copies of some of the programs. Back then, "source control" meant incrementing a counter at the end of the file name (PROG1.BAS, PROG2.BAS, etc.).
That backup disk is the only record I've found of my programming activities prior to gaining internet access. I'm glad I found it! It's humbling to see inscrutable variable names, inefficient algorithms, and duplicated code all over the place. I guess we all have to start somewhere!