Your Imagination Is Required With Comp Control for the ZX81
More of a simulation, this program is more fun with other play.
As a young teenager, I often wrote programs that I would integrate into other play. In this case, I had probably watched War Games again. The idea of a computer talking to you made for some fun fantasy play. Comp Control a little pretend play where my lowly ZX81 mimicked a much more sophisticated world. I’m sure I was running around my room thinking up some crazy way to save the world.
Fantasy play can be a lot of fun.
As a stand along program, it is pretty basic. You have to type in the password—something I simplified and shared so you don’t have to guess it. The original was pretty much random characters. Guess I missed that plot point in the movie.
The computer will then ask you how you are. You can respond with a word or a sentence. The program will scan the input for keywords. If you use any, it will then print a message or do things. Most are non-linear and don’t lead to anything. This isn’t an adventure game. I had a set script in my head and the game allows me to run that script.
As such, the program isn’t that exciting. It is meant to be played as part of an inner story. Think of Comp Control as a prop, a toy for your play. Not quite what I would play in my fifties, but it was perfect at 14. It was a great way to mimic the real world, but still be engrossed in fantasy. Funny how games like this play out.
A bit more under the hood.
Although I knew Comp Control wasn’t a real game, I was surprised at the sophistication of the code. To make it easier to enter, I typed in the program in JSZeddy and compiled the BASIC code there. It didn’t take long, but as I typed it in I was trying to understand what it did. It didn’t take me long to figure out what I had done. Comp Control is basically a simplified parser.
What it does is take the inputed statement, what ever is typed, and loops through each character. As it does, it then runs a series of tests to see if a slice (I.e.
A$(A TO A+3)="GOOD") to see if the word matches at that character. If so, it does something. If not, it keeps trying until it reached the end of the array.
Perhaps a bit brute force, the process works pretty well. The only issue is that is really slow. I must have figured that out as I had added in
SLOW routines around the check to speed things up. Having some experience with z80 assembly now, I could create a much faster and sophisticated parser. But that is now, and not quite indicative of my skills and knowledge back then.
Trying things out.
Spoiler, if you wanted to figure out the keywords on your own, you might want to skip this section until you’ve tried out the program! The parser understands a few different scenarios, each broken up with an
The first test relates to the “How are you?” question. If you answer with a positive word, such as FINE, GOOD, WONDERFUL, or TERRIFIC, Comp Control will print a message about that.
If you use keyword GAMEs, the program will print a list of games. These are real games I wrote. I didn‘t check, but I‘m sure I‘ve pushed all of them here. Let me know if any are missing.
If you type STATUS or GOING, Comp Control will transfer to a new section. There it will tell you about the games and expectations. It will then mimic loading them. You can skip that by using the RETURN or GO keywords.
The next check is a bit devious. If you use the world KILL, the program will erase. No, I mean it! The program runs the NEW command and everything ends. Kind of crazy I would put that in there given how long it takes to load, but I‘m sure I had my reasons.
The next check is for STOP, BYE or CIAO. This command would end the program, but doesn‘t erase it. If you were wondering about the ciao, it belays that I was living in Italy when I wrote this. Sadly, I spelled it wrong in the listing‘I fixed it for this release.
The next test will look for RESTART, RUN or BEGIN AGAIN. After finding one of these keywords or phrases, it will start over by using the RUN command. You will get the PASSWORD prompt again, noting that the game has restarted.
The final command is really to deal with the screen filling up. You can type CLS or CLEAR to clear the screen. If you don‘t, Comp Control will end when it runs out of room to print responses.
The notable thing from all the checks is what is missing. Things like EXIT or QUIT aren‘t tested. Remember, I was the product of what I read. Those terms were widely used back then, at least not in relation to the BASIC programming language and the ZX81. I notice them now, but back then they didn‘t immediately pop to mind.
The other thing to note is the program is really meant to have sentences typed in. I set the A$ variable to 96 characters. That is three lines of text, something most people would never type into a ZX81. But again, remember I was role playing. In response to the first prompt, I could easily have typed, “I AM FINE. HOW ARE YOU DOING TODAY?” The answer is the same in either case, but the meaning takes on more context.
Wrapping it up.
In the end Comp Control, which by the way is short for Computer Control, surprised me with the level of effort I put into what is really just a simulator. I had fun playing as 14 year old me, thinking about the scenarios I could be in as I typed in answers to the questions. I‘m surprised I never used this concept to make an actual game. That could be something to try in the future. Although, I might write in assembly to speed things up.
In this end, this short program was a fun jog down memory lane. Although I don‘t have the listing for it, it reminded me of a graphic program that I also role played with. I‘ll need to see if I can dig out the drawing. Typing this in inspired me to recreate that idea.