1 REM THERE'S GOLD IN THEM THERE SKYSCRAPERS FROM
2 REM 34 MORE TESTED, READY TO RUN GAME PROGRAMS IN BASIC
4 REM SOME MODIFICATIONS WERE NEEDED FOR MBASIC, DONE BY PETER DASSOW
5 GOSUB 700:PRINT:FOR X=1 TO 100: LET @(X)=0: NEXT X
10 PRINT "GOLD IN THEM THERE SKYSCRAPERS"
15 INPUT "ENTER 1 FOR INSTRUCTIONS OR 2 FOR GAME: ";X
20 IF X=1 THEN GOTO 450
25 REM ** PUT DOORS IN ALL ROOMS
30 FOR X=101 TO 200:LET @(X)=15:NEXT X
35 REM ** REMOVE IMPOSSIBLE DOORS
40 FOR X=391 TO 410: PUSH X: GOSUB 870: NEXT X
45 LET Y=201:FOR X=1 TO 10
50 PUSH Y:GOSUB 870:LET Y=Y+10:NEXT X
60 LET Y=110:FOR X=1 TO 10
65 PUSH Y:GOSUB 870:LET Y=Y+10:NEXT X
70 REM ** REMOVE RANDOM DOORS
75 LET Y=RND(5)+1
80 FOR X=1 TO Y:LET Z=RND(400)+101
90 PUSH Z:GOSUB 870:NEXT X
100 REM ** PLANT TRAP DOORS
105 LET Y=RND(20)+1
110 FOR X=1 TO Y:LET Z=RND(90)+11
120 LET @(Z)=4:NEXT X
122 LET Y=RND(40)+1:FOR X=1 TO Y
123 LET Z=RND(100)+1
124 LET @(Z)=5:NEXT X:LET S=5
125 REM ** PLANT EXITS & GOLD
130 FOR X=1 TO 3: LET Y=RND(10)+1
135 LET @(Y)=3:NEXT X:LET @(1)=1
140 LET X=RND(99)+2:LET @(X)=2
150 REM ** SET GAME VARIABLES
155 LET M=1: LET P=1:LET G=0
160 LET E=3:LET U=10:LET D=-10
170 LET R=1:LET L=-1
180 LET H=X:REM REMEMBER THE GOLD ROOM
200 PRINT "MOVE #";M:LET M=M+1
205 PRINT "YOU ARE IN ROOM #";P
210 LET X=@(P)
215 IF X=2 THEN GOSUB 400
220 IF X=3 THEN PRINT "THERE IS AN EXIT."
225 IF X=4 THEN GOTO 420
227 IF X=5 THEN PRINT "THERE IS A SECRET PASSAGEWAY (COMMAND 'SECRET') "
230 PRINT "YOU CAN MOVE IN THE FOLLOWING DIRECTIONS --- ";
235 PUSH P+200:GOSUB 890:IF POP()=1 THEN PRINT "LEFT ";
240 PUSH P+100:GOSUB 890:IF POP()=1 THEN PRINT "RIGHT ";
245 PUSH P+300:GOSUB 890:IF POP()=1 THEN PRINT "UP ";
250 PUSH P+400:GOSUB 890:IF POP()=1 THEN PRINT "DOWN ";
255 PRINT: PRINT
260 INPUT "YOUR MOVE (0=Exit 1=Left 2=Right 3=Up 4=Down 5=Secret 6=Help): ";Q
265 IF Q=0 THEN GOTO 300
270 IF Q=1 THEN N=L:GOTO 370
275 IF Q=2 THEN N=R:GOTO 340
280 IF Q=3 THEN N=U:GOTO 380
285 IF Q=4 THEN N=D:GOTO 390
287 IF Q=5 THEN GOTO 600
288 IF Q=6 THEN PRINT "TRY ROOM ";H:PRINT:GOTO 260
290 PRINT "INVALID MOVE!"
295 GOTO 200
300 IF @(P)=E THEN GOTO 310
305 GOTO 290
310 PRINT "YOU HAVE JUST LEFT THE BUILDING WITH";
315 IF G=0 THEN PRINT "OUT";
320 PRINT " THE GOLD."
325 LET M=M-1
330 PRINT "IT TOOK YOU ";M;" MOVES."
335 END
340 REM ** MOVE = RIGHT
345 LET X=P+100
350 PUSH X:GOSUB 890:IF POP()=1 THEN GOTO 365
355 PRINT "YOU JUST RAN INTO A WALL, CLOD!"
360 GOTO 200
365 LET P=P+N:GOTO 200
370 REM ** MOVE = LEFT
375 LET X=P+200: GOTO 350
380 REM ** MOVE = UP
385 LET X=P+300: GOTO 350
390 REM ** MOVE = DOWN
395 LET X=P+400:GOTO 350
400 PRINT "YOU JUST FOUND THE GOLD!"
405 LET @(P)=0: LET G=L
410 RETURN
420 PRINT "TRAP DOOR!"
425 LET P=P-10
430 FOR X=1 TO 333:NEXT X: REM DELAY
440 GOTO 200
450 PRINT "YOU JUST HAVE TO FIND YOUR WAY WITHIN THAT BIG BUILDING."
460 PRINT "TRY TO FIND THE ROOM WITH THE GOLD, THEN EXIT"
470 PRINT "THE BUILDING. TRY TO USE A MINIMAL NUMBER OF STEPS."
480 GOTO 15
590 REM ** Secret Passageway Option
600 IF @(P)=5 THEN GOTO 620
610 GOTO 290
620 GOSUB 700:LET P=RND(100)+1
630 FOR X=1 TO 456: NEXT X
640 GOTO 200
700 FOR V=1 TO 24:PRINT:NEXT V
710 RETURN
750 REM ** uBasic bitmap interface
800 IF TOS()<201 THEN B=8 : C=POP() : RETURN
810 IF TOS()<301 THEN B=4 : C=POP()-100 : RETURN
820 IF TOS()<401 THEN B=2 : C=POP()-200 : RETURN
830 IF TOS()<501 THEN B=1 : C=POP()-300 : RETURN
840 PRINT "Subroutine failure":END
870 GOSUB 800 : IF (@(C)/B)%2=1 THEN @(C)=@(C)-B 
880 RETURN
890 GOSUB 800 : PUSH (@(C)/B)%2 : RETURN
900 REM ** Originally, this game required an array
910 REM of 500 elements, 100 for the rooms and 
920 REM 100 for each direction. By using a bitmap
930 REM pattern of 4 bits, only an additional 100
940 REM elements were required. The subroutines at
950 REM line 800 translate the original parameters
960 REM to the bitmap pattern used in uBasic. **