My First Programming Project

Last year, my dad was cleaning up and came across my first real programming project. When I was 10 or 11 years old, in sixth grade, my school offered programming classes. The class was taught in BASIC on IBM PCjrs and focused primarily on graphics. This is like 1991-1992.

This is the old school BASIC, where you had to label each line with a line number and we had a dot-matrix printer if we wanted to save our programs. The teacher would hand out special grid paper which accounted for the rectangular pixels that we were working with and it would help out with our assignments. The thing is that this wasn’t even our first real exposure to programming, since the preceeding 2 years, we had computer classes where we wrote LOGO (you know, the turtle that you’d control with a series of commands) and drew pictures on these Atari computers. We never really did much more than RT 90 and PEN UP/PEN DOWN commands, but for my final project, I drew a simplified GameBoy.

Anyway, I loved this class. It was so cool. Our teacher showed us some projects that the 7th and 8th graders had done, and they did some simple animation by clearing the screen and drawing the next frame, so I asked a lot of questions. We had pretty much only learned how to change color, do fills and draw lines and shapes, but the teacher showed me how to write a FOR loop and I kinda understood what it was doing and I had an idea.

Graphics reference with my original diagonal stick, which was too much work.

For my class project, I was going to draw a stick of TNT, animate the sparks on the fuse by cycling through the colors (the colors were indexed 0-15). I don’t know how long I actually spent on it but I swear it felt like a week. And if you had asked me how much code it was, by my recollection, it was like 100 lines of code.

Some printed source code

So this is all the code. I got an A even though it’s only 16 lines. I had to jam in the FOR loop on line 55, so it doesn’t just count by 10s. This concept of numbering one’s lines is so weird and I can’t imagine how it must feel to see this for folks who only got exposed to software in the 2000s.

I’ll transcribe the source here, for posterity (and to show off cool BASIC syntax highlighting):

10 CLS
20 KEY OFF
30 SCREEN 3
40 LINE (90,30)-(55-160),4,BF
50 LINE (70,30)-(70,20),1
55 FOR A= 1 TO 15
70 LINE (79,8)-(71,18),A
80 LINE (74,15)-72,18),A
90 LINE (67,13)-(69,18),A
100 PSET (66,8),A
110 PSET (63,15),A
120 PSET (73,4),A
130 PSET (76,17),A
140 NEXT A
150 GOTO 55

I’d love to find somewhere that I could run this again.

It’s kinda crazy how low resolution this is, which you can tell by the magnitude of the numbers. I had another version that would fill the screen with white to signify an explosion and then end. This one just loops forever, animating the fuse.

The shitty thing is that the year I got this class was the last year they offered programming in middleschool. The following year, the school got new Macs and we were given a typing class instead. For some reason, my town really dumbed down the computer class offerings after that and I wasn’t able to take another programming class until senior year of high school when they offered C++ for the first time, but that’s another story.

After taking this class, I discovered that we had QBASIC on our home DOS computer and I picked up some books at the book store because I was bitten by the programming bug. I do wish I took it more seriously, though, but I did manage to build a simple Pong game. I had an epiphany one night about how to animate a bouncing ball and then it was cake to control a paddle and bounce it around, but I had no score nor did I track when the ball missed.