In-game screen.

Program listing on 48K Spectrum.

Text Listing

 LET a$="":
 POKE 23693,7:
 CLS :
 FOR k=1 TO 4:
 CIRCLE 131,84,CODE " #NR"(k):
 INK k:
 LET e=k=2 OR k=4:
 PRINT AT 6+10*(k>2),11+10*e;k:
 FOR p=-23 TO 0:
 PLOT 232*e-88-p,33-(k<3)*168-p:
 DRAW OVER 1;31,0:
 NEXT p:
 INK 8:
 LET a$=a$+"1234"(RND*4+.5):
 NEXT k:
 PRINT AT 10,14;"SIMON";AT 12,16;p:
 FOR d=-2*PI TO 6 STEP PI/2:
 PLOT 131+35*SIN d+4*SGN d*COS d,84+35*COS d-4*SGN d*SIN d:
 DRAW 42*SIN d,42*COS d:
 NEXT d:
 FOR c=1 TO p:
 LET q=VAL a$(c):
 FOR v=1 TO 8:
 BEEP (v=5)/2,q*5-8-3*(q=4):
 PRINT AT v+4*(v<5)+9*(q>2),16*(q=2 OR q=4); OVER 1; BRIGHT v<5,:
 NEXT v:
 NEXT c:
 FOR c=1 TO k:
 POKE 23620,13+2*(c<=p)*(10+(q$>"0")*(q$<"5")-5*(q$=a$(c))):
 BEEP 1,-9

Download the game


The goal of this game is to watch and listen to the sequences of flashing lights and then repeat them by pressing the numeric keys 1-4. The game starts with a sequence of one flashing light and progresses to longer sequences by adding an extra flash to the sequence on each turn. The length of the current sequence is indicated by the number in the middle of the game board.
The BORDER is black whilst the CPU plays the current sequence (to be carefully observed by the player). When the sequence has finished playing, the border turns yellow to indicate the computer is ready to accept the player's input. There is no time limit on the player's input as the computer will wait indefinitely. If an incorrect button is pressed, then the game immediately ends with the board displaying the length of the current sequence that the player failed to reproduce correctly. Try to stay in the game as long as possible and you will notice that it gets considerably more difficult as the sequence gets longer. Each button has it's own unique note associated with it. More experienced players can remember the sequence as a tune, rather than as a sequence of numbers, which can help to remember longer sequences more easily.

About the game

This one-liner game was inspired by the well known Simon electronic game. Dr BEEP had originally made a one-liner game of this type called MUSICPLAYER and this is freely downloadable as part of his groundbreaking ONELINERS package. The original idea to make the version on this page was sent to me by Einar Saukas, back in 2007. The initial version of this implementation was by Digital Prawn, after examining Dr. BEEP's MUSICPLAYER code. This version therefore borrows heavily from it. In particular, several of the program variables perform the same function, the random generator works in the same way. Also, the core algorthim of tune playback and user input detection works in fundamentally the same way as Dr. BEEP's original version.

The initial version of the game needed many optimisations so that the graphics could be refined and the score printed onto the screen. These features could not originally be fitted into the available one-liner space. However, due to countless optimisations and refinements by Einar Saukus and Dr. BEEP, enough space was saved in order to greatly improve the game. Additional suggestions were supplied by bigjon. Apart from optimisations, particular improvements were suggested by Einar Saukas (for example, the use of a black background because it works well when we use the BRIGHT attribute to flash the buttons), and also Dr. BEEP (for example, the use of PLOT and DRAW to draw the neatly shaped buttons).

Back to Sinclair stuff index