December’s Program: Dollar Sign


Quickly get to the goal without hitting a bomb in this ZX81 game.

[Dollar Sign, 1984]Winter has set in and it is time to close out the year with a simple game. Dollar Sign, December’s program of the month, is that game.

All you need to do is move your character, which surprisingly looks like a dollar sign, into the inverse, dare I say it, dollar sign. Yes, I was nothing if not obvious in my young age. To make it a bit interesting, you need to maneuver around the dots scattered around the screen. You use the 5-8 keys to move in the directions of the arrows on the keys. By the way, those dots are actually bombs and will end your game. Remember this is a ZX81 program from the ‘80s so please use your imagination. If this sounds like fun, then give it a quick try first.

Like many of my programs, Dollar sign is a variation on the same theme. You won’t find much new code here. The creation, movement, and collision detection have all been used before. You’ll find the movement pretty fast given that the dollar sign is the only object moving on the screen. Back when I wrote this, I did think the merging of the character with the goal into a solid block a clever touch. Sometimes simple is best.

The bomb field is probably the most unfair part of the game. It is simply a loop of randomly placed dots that I’ve used many times before. If the background was black, it makes a great star field. Unfortunately, it does take time to run the loop. Quick use of our faithful FAST command shortens that wait and drops us quickly into the game. Back to the unfair part. Because the bombs are placed randomly you are often boxed in and cannot move. Fortunately, Dollar Sign’s aim is just to track how long it takes to get to the goal, so you can simply die and try again. Most of the time you can make it.

Usually first time programmers miss the little touches. For example, you can easily die on your first move. I could have saved a few bytes of memory and just printed “MOVES” or even “MOVE(S)” when display your move count. I’m not sure why I bothered, but decided to check whether to add the “S” when the move count was greater than one. I could have used “S<>1” to properly deal with zero, but since you have to move at least once it didn’t matter here. The elegant part is that the decision to display the “S” is done using a boolean check within the same PRINT command. This works well since I wanted to print a period at the end of the sentence and avoids adding two more lines of code. I still marvel over the little touches in ZX81 BASIC.

Dollar Sign isn’t unique, but it is minimal and elegant. It is a nice little program to end the year. Now if only I’d bothered to make every run winnable. Perhaps it is best to leave that exercise to you.

If you want to run this program on your Android phone or tablet you can download a compressed copy of the program to your device. You’ll need to save the .p version of the program to your device to allow Zed Ex (Beta) to run it.



Comments on this article:

No comments so far.

Write a comment:

Type The Letters You See.
[captcha image][captcha image][captcha image][captcha image][captcha image][captcha image]
not case sensitive