Forest Treasure

See all articles from SYNC v1 n3

“Forest Treasure” is based upon “Random Graphics” by Gary McGath in the Jan/Feb 1981 issue of SYNC. You are riding through a forest, seeking the gold treasure. You are represented by “£” and the treasure is a blank space. During your ride you may encounter enchanted (invisible) walls. When touched, these walls will alter your path, sending you in different directions (sometimes even leaping over the wall!). You may also encounter a monster, represented by the “M” square. This monster has the magical ability to duplicate itself in its search for you. If you run into a monster, or if the monster lands on you, or if the monster steals the treasure, you lose. If you get the treasure, you win. You control your movements by entering U, D, R, or L for up, down, right, or left, and then pressing NEWLINE. Entering S will exit you from the program.

Screen of grey forest squares with the £ rider, several M monsters and the blank treasure square
Screen of grey forest squares with the £ rider, several M monsters and the blank treasure square
10 FOR I=1 TO 20
20 FOR J=1 TO 30
30 PRINT " ";
40 NEXT J
50 PRINT
60 NEXT I
70 DIM A(50)
80 DIM B(75)
90 LET C=0
100 LET E=RND(20)
110 LET F=RND(30)
120 LET T=RND(619)
130 POKE PEEK(16396)+256*PEEK(16397)+T,0
140 FOR I=1 TO 75
150 LET B(I)=RND(1000)+17300
160 NEXT I
170 LET M=RND(619)
180 POKE PEEK(16396)+256*PEEK(16397)+M,50
190 LET C=C+1
200 LET A(C)=PEEK(16396)+256*PEEK(16397)+M
210 IF A(C)=PEEK(16396)+256*PEEK(16397)+T THEN GOTO 490
220 LET H=F+31*(E-1)
230 POKE PEEK(16396)+256*PEEK(16397)+H,12
240 LET N=PEEK(16396)+256*PEEK(16397)+H
250 FOR I=1 TO C
260 IF A(I)=N THEN GOTO 460
270 NEXT I
280 IF N=PEEK(16396)+256*PEEK(16397)+T THEN GOTO 430
290 INPUT A$
300 IF A$="S" THEN LIST
310 POKE PEEK(16396)+256*PEEK(16397)+H,18
320 FOR I=1 TO 75
330 IF B(I)=N THEN GOTO 400
340 NEXT I
350 IF A$="R" AND F<30 THEN LET F=F+1
360 IF A$="L" AND F>1 THEN LET F=F-1
370 IF A$="D" AND E<30 THEN LET E=E+1
380 IF A$="U" AND E>1 THEN LET E=E-1
390 GOTO 170
400 LET F=F+RND(9)-5
410 LET E=E+RND(9)-5
420 GOTO 170
430 POKE PEEK(16396)+256*PEEK(16397)+T,148
440 PRINT "YOU HAVE TAKEN THE TREASURE"
450 GOTO 500
460 POKE PEEK(16396)+256*PEEK(16397)+H,19
470 PRINT "THE MONSTER HAS KILLED YOU"
480 GOTO 500
490 PRINT "THE MONSTER HAS STOLEN THE TREASURE"%
500 PRINT "ANOTHER GAME? (Y/N)"
510 INPUT B$
520 CLS
530 IF B$="Y" THEN RUN
540 LIST

Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.