Cube - by Dr. BEEP

In-game screen.

Program listing on 48K Spectrum.

Text Listing

1 DEF FN a(r,n)=r-INT (r/n)*n:
 READ c$,m,n,v,p:
 LET x=RND*36+10:
 LET x$=c$(x):
 POKE n*(x$>"O"),3:
 LET c=FN a(3+PEEK 23673,256):
 CLS :
 LET x=x+n*(c$(p)=x$):
 PRINT "Room:";FN a(CODE c$(p),40)^2:
 FOR g=1 TO 4:
 LET h$=c$(p+CODE "IQWO"(g)-80):
 PRINT INK x$=h$;"NESW"(g);":";STR$ (FN a(CODE h$,40)^2) AND h$<"z":
 NEXT g:
 POKE n*(c<>PEEK 23673),14+11*(k>0):
 LET h=m*v+9:
 LET v=8-v:
 LET n$=c$:
 FOR g=0 TO 5:
 LET c$(h+g*v)=n$(h+(g*v+v)*(g<5)):
 LET p=p+(h+g*v-p)*(n$(p)=c$(h+g*v)):
 NEXT g:
 LET m=FN a(m+1,6):
 POKE n,6:
 LET d=(k=8)-(k=5)+7*((k=6)-(k=7)):
 LET p=p+d*(c$(p+d)<"z"):
 POKE n*(p>8*(x>n))*(c$(p)<"P"),7:
 DATA "zzzzzzz()RS,U.zW012[4z]678a:zc<=>g\@zABCDEFzoHIJKLzzzzzzz",0,23620,1,8

Download the game

The Story

You awake inside a small cube shaped room, unsure as to how you arrived here. All you can see are strange numbered exits. After a while you sense that the room you are in is moving. Perhaps there is some logic behind all of this? Be careful which exits you choose, for making a mistake could prove to be fatal! Will you eventually be able to escape the Cube alive?


This game uses CURSOR keys as follows:- 5-West, 6-South, 7-North, 8-East. The ingame screen indicates which room number you are currently in as well as the numbers of adjoining rooms accessible through the available exits. Choose your exit carefully by pressing one of the above CURSOR keys, and if all is well you will move into another room. Choose poorly, and you will lose the game by suffering an untimely death and the program will exit. The goal of the game is to explore the maze in order to find the exit key, then return to the initial room where the exit is located.

Help with the game

Warning *SPOILER*. Read this hint if you are stuck trying to understand the singificance of the numbers.
Rooms numbered as square of prime numbers are "killer rooms" (and thus must be avoided).

About the game

This game idea was developed, designed and implemented by Dr BEEP. Thanks also to Einar Saukas for pointing out a bugfix regarding the room data. This game also uses the middle byte of the TVCOUNT/FRAMES system variable as found in the game A-Maze. This game is based on the film CUBE.

Back to index