The following program is a translation of a TS1000 program that I originally translated from Cavern Quest for the Commodore Pet (whew!). It’s a maze game – you search through the nodes of the printed circuit for the prize (the data), and then must find your way back to the entrance port. There are no monsters or random occurences, just a lot of choice points and limited information. With the luxury of plenty of memory, I’ve added a graphic plan of the maze.
Type in the listing as shown; SAVE it with GOTO 9000, and it will auto RUN upon loading.
Variables, as they appear:
x$(12,14) Holds object descriptions
c$(416) Clears upper screen
i General counter
z Object counter
t Iteration counter (>300=more rooms)
During play, flags posession of data
a$(300) Maze array (>300=less overlap of
passages; but change lines 110, 550
also)
a Position in maze; node number
d Proposed change to "a"
l Proposed new value for "a"
j East-West movement value
v North-South movement value
c Up-Down movement value
PEEK 23689 Picks up print position on screen
You can eliminate the visual plot of the maze by removing lines 155, 215, and 271.
I’m thinking of suing Tron for plagarism: any potential backers in this please let me know. I’m also interested in any working circuits this produces: see Computer Intelligence: Artificial or Counterfeit in this issue.
1 REM Circuit quest '86
2 DIM x$(12,14): DIM c$(416)
3 FOR i=1 TO 12
4 READ a$: LET x$(i)=a$
5 NEXT i
10 LET z=0: LET t=300: DIM a$(300): LET a=10: LET a$(a)="*"
28 REM **** Create Maze ******
29 PRINT "Creating Maze"
30 LET t=t-1: IF t<1 THEN GO TO 240
35 LET d=INT (RND*7): REM random value between 0 AND 6
40 IF d=2 THEN LET d=-1
50 IF d=3 THEN LET d=-10
60 IF d=4 THEN LET d=10
70 IF d=5 THEN LET d=-150
80 IF d=6 THEN LET d=150
90 IF d=0 THEN GO TO 180: REM place object
100 LET l=a+d
110 IF l>300 OR l<1 THEN GO TO 30
120 IF a$(l)>"7" THEN GO TO 30
140 LET a$(l)="1"
150 IF d=-150 THEN LET a$(l)="8": LET a$(a)="9"
155 CIRCLE 3+6*(INT (a/10)),3+6*(a-(10*INT (a/10))),2
160 IF d=150 THEN LET a$(a)="8": LET a$(l)="9"
170 LET a=l: GO TO 30
179 REM *** Place Objects ******
180 IF RND*300<150 OR a$(a)<>"1" THEN GO TO 30
190 LET z=z+1
200 IF z>=12 THEN GO TO 30
210 LET a$(a)=CHR$ (z+65)
215 PRINT x$(z): CIRCLE 3+6*(INT (a/10)),3+6*(a-(10*INT (a/10))),1
220 GO TO 30
230 REM **** Place Treasure ****
240 LET a$(a)=CHR$ (12+65): PRINT x$(12)
245 LET a=10
249 REM *** Main Loop *********
250 PRINT AT 0,0;c$: PRINT AT 0,0;a: IF a<>10 THEN GO TO 270
260 PRINT "I-O Port"
261 IF t<>1 THEN GO TO 270
262 PRINT "$$$$$ You made it! $$$$$"
263 GO TO 262
269 REM *** Directions ********
270 PRINT "Conductors lead: ";
271 PLOT 3+6*(INT (a/10)),3+6*(a-(10*INT (a/10)))
275 IF a>10 THEN IF a$(a-10)<>" " THEN PRINT TAB 20;"North"
280 IF a<290 THEN IF a$(a+10)<>" " THEN PRINT TAB 20;"South"
290 IF a>1 THEN IF a$(a-1)<>" " THEN PRINT TAB 20;"West"
300 IF a<300 THEN IF a$(a+1)<>" " THEN PRINT TAB 20;"East"
310 IF a$(a)="8" THEN PRINT TAB 20;"Down"
320 IF a$(a)="9" THEN PRINT TAB 20;"Up"
329 REM *** Object sights *****
330 IF a$(a)<="9" THEN GO TO 450: REM All objects are flagged by values greater than ASCII "9"
340 PRINT "You see ";x$(CODE a$(a)-65)
350 IF a$(a)="M" THEN LET t=1: PAUSE 30: LET a$(a)=" "
440 REM *** Get direction info
450 LET j=0: LET v=j: LET r=j
460 LET j=( STICK (1,1)=8)-( STICK (1,1)=4)
470 LET v=( STICK (1,1)=2)-( STICK (1,1)=1)
480 LET r= STICK (2,1)
490 IF j+v+r=0 THEN GO TO 460
500 LET l=a+150*(a$(a)="8" AND r)-150*(a$(a)="9" AND r)+10*v+j: REM Update position: LET l=a-(sub. c only if a$(a)="8" and climb has been selected,+c only if "9" AND climb,+10*v+j)
550 IF l<1 OR l>300 THEN GO TO 600
560 IF (a$(a)<"8" AND r) OR a$(l)=" " THEN GO TO 600: REM LET l=a-( GO TO deadend sub only if a$(a)="8" and climb has been selected)
570 LET a=l
580 GO TO 250
600 PRINT "--No-current-path--": IF PEEK 23689=13 THEN PRINT AT 0,0;c$;AT 0,0;
610 GO TO 450
1000 DATA "a NAND gate","an OR gate","a ROM","a blown fuse","a volume control","a RAM chip","a resistor","an empty socket","a flip-flop","a solder pad","a LED","THE DATA !!!!!!!"
9000 CLEAR : SAVE "c-quest" LINE 1
9001 SAVE "c-quest" LINE 1
Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.