A downloadable game

Hidden Shape

A 10 liner program for ZX81 / TS1000

by

Alex Boutin

March 15th, 2026

The goal of the game is to find what is the hidden shape. The image is progressively revealing to you and, randomly (or pseudo-randomly), the image will freeze, a “L” will appear, then the game will be waiting for an input : simply (slowly) type your answer, and hit enter. If you got the good answer, a congratulation message will appear and then the image will continue its progression up to full completion. But if you're wrong, you'll get a consequence. It's possible to avoid or cancel the consequence. To exit the game, simply type “E” instead of your guess, and hit enter... or, if you've already found the answer (and therefore no more input line), you can hold the “E”. The game was originally developed for the Timex Sinclair 1000, but it works better with the Default Settings of EightyOne Emulator (16K ZX81).


Listing (text):

   1 LET A$="OOOOOOOOOOOOOOOOOOOOOOOOOO%OOOO%OOOOOO%O%O%O"+"O%O%O%OOOOO%O%O%O"+"%O%O%O%OOOOO%O%O"+"%O%O%O%O%OOOOOO%O%O"+"%O%O%OOOOOOOO%O%O%OOOOOOOOOO%OOOOOOOOOOOOOOOOOOOOOOOOOOOO"
   2 PRINT AT 0,0;"WHAT IS THE HIDDEN SHAPE?",,,"""E"" TO EXIT"
   3 LET B$=""
   4 LET B=(INT (RND*121))/11
   5 PRINT AT INT B+5,(B-INT B)*11+10;A$(B*11+2);B$
   6 IF B<0.5 AND A$(1)="O" THEN INPUT B$
   7 IF B$=CHR$ 45+"E"+CHR$ 38+CHR$ 55+"T" THEN LET A$(1)="%O"
   8 IF A$(1)="%O" THEN PRINT AT 20,0;"BRAVO"
   9 IF A$(1)="O" AND B$<>"E" THEN GOTO 4
  10 IF A$(1)="%O" AND INKEY$<>"E" THEN GOTO 3

Character count (from the exported listing):

Line 1 179

Line 2 63

Line 3 14

Line 4 29

Line 5 51

Line 6 41

Line 7 62

Line 8 45

Line 9 41

Line 10 46

Note about the real character count : on the exported HS.b81, 2 characters are used for the contrast reversed letter instead of one on the real machine. In this program, contrast-reversed-O are noted as %O in the exported file. Therefore, there is many contrast-reversed-O in the program, so the real characters count is lower. Anyway, in all case, the longest line remain Line 1, and the count remains between 120 and 256 characters in both case, so it doesn't change anything for the category.

Line by line description:

Line 1 LET most of the data of the game (i.e. the game status and the hidden shape) be included in the A$ chain.

Line 2 PRINT the game instructions on the screen.

Line 3 LET an empty chain be assigned to B$

Line 4 LET a pseudo-random number be assigned to the B variable. First part of the formula is generating a integer between 0 and 120, then secondly, that number is divided it by 11.

Line 5 PRINT (pseudo-randomly) one of the 121 characters from the hidden shape picture AT the right position. The image is 11 x 11, and was recorded like a text (i.e. from left to right, top to bottom). The line number  (i.e. top to bottom, 0 to 10) is obtaining by getting the integer value from B (and 5 is added for centering). And for the lateral position (left to right, 0 to 10), we just need to expend the decimal portion of B by calculating the B*11 modulo 11. But there is no modulo function in Sinclair Basic (at least, as far as I know, nothing readily available on the Basic of the ZX81). So, a kind of equivalent process is used in which the decimal value is isolated then expended in the 0 to 10 range. To do so, the integer of the pseudo-random number B is subtracted from B. This way, we obtain the decimal part only, then multiplying this number by 11 is reveling that left/right coordinate (and 10 is added for centering). To summarize, the coordinates are comprised in this the range (0 to 10)+5, (0 to 10)+10. Then, the associated character is selected by multiplying B by 11 (to get integers between 0 and 120) plus 2 (because A$ is containing another data at the first position). Then, for the consequence, B$ is printed next to the image generation character.

Line 6 Verify IF the pseudo-random number B is below 0.5 AND if the first character of the A$ chain is O (this is the game status character, O for still actively playing, and contrast-reversed-O after the answer has been found), THEN wait for player INPUT (the image construction is paused until the player types an answer and hit enter [or NEW LINE]).

Line 7 Verify IF the right answer has been entered THEN LET change the game status variable A$(1) to contrast-reversed-O if successful.

Line 8 Verify IF the game status character is contrast-reversed-O , THEN PRINT a congratulation message AT the lower portion of the screen.

Line 9 Verify IF the game status in A$(1) is O [i.e. no good answer yet] and IF the input (in B$) isn't “E”, THEN GOTO 4 [Line 4] to continue playing (with possibly a consequence). 

Line 10 Verify IF the game status in A$(1) is contrast-reversed-O [i.e. The good answer has been found] and IF the INKEYS isn't “E”, THEN GOTO 3 [Line 3] to continue playing without consequence (and without any more INPUT). INKEY$ (for reading which key is pressed) is used instead of the B$ chain content because the B$ never change under contrast-reversed-O game status. This way, “E” can be used to escape in both mode/status.

Download

Download
HS.p 820 bytes
Download
HS.wav 1 MB
Download
Hidden Shape (2026).doc 93 kB
Download
Hidden Shape (2026).pdf 72 kB
Download
Hidden Shape (2026).txt 6.5 kB
Download
HS.b81 591 bytes
Download
HS-listing.JPG 17 kB
Download
HS-listing-txt.txt 591 bytes

Install instructions

Loading the game on EigtyOne emulator

About using EigtyOne emulator, the default settings (on version 1.41) are 16K ZX81 and the game is working great with these settings : therefore, I recommend to use the default settings, and, in case of doubt, to force to default settings by clicking Option / Configuration / Reset to Default Settings.

The game is designed for the slow mode, and because the slow mode is the default mode on EightyOne emulator, you don't need to do anything special for it (except if you ran a program in fast mode just before, you can force back to slow mode by doing the Reset to Default Settings, then reload the game). 

Now, you're ready to load the program. 2 files are included : HS.wav for enjoying a slow loading and HS.p than can be loaded more easily and almost instantly. The next step is to click File, then Open Tape, and and then choose HS.wav or HS.p depending of your preferences. Normally, if you have chosen HS.p , it should automatically load (after few seconds, LOAD "" should appear on the screen, then the 0/0). And if you have chosen HS.wav, you have to enter LOAD "" manually (J Shift+P Shift+P ENTER). To list it, press K, then enter. And to run it, press R, then enter. 

So, to summarize, the easiest way to load/run this game on EigtyOne emulator is first to Reset to Default Settings, then to Open Tape HS.p, then wait until 0/0 appears, then press R, then press enter, and then you are playing. 

Leave a comment

Log in with itch.io to leave a comment.