10 PRINT TAB(24);"TWONKY" 20 PRINT TAB(18);"CREATIVE COMPUTING" 30 PRINT TAB(16);"MORRISTOWN NEW JERSEY" 40 PRINT:PRINT:PRINT 140 GOSUB 2250 150 DIM A(15,15) 160 LET R9=0 170 GOSUB 1830 180 PRINT "------------------------------------------" 190 PRINT 200 GOSUB 1450 210 PRINT 220 PRINT "MOVE OR SHOOT (M/S)"; 230 INPUT Q8$ 240 IF Q8$="M" THEN 270 250 IF Q8$="S" THEN 950 260 GOTO 210 270 PRINT "WHICH WAY (F/B/R/L)"; 280 INPUT Q$ 290 IF Q$="F" THEN 340 300 IF Q$="B" THEN 370 310 IF Q$="L" THEN 400 320 IF Q$="R" THEN 430 330 GOTO 210 340 LET X5=X 350 LET Y5=Y-1 360 GOTO 460 370 LET X5=X 380 LET Y5=Y+1 390 GOTO 460 400 LET X5=X-1 410 LET Y5=Y 420 GOTO 460 430 LET X5=X+1 440 LET Y5=Y 450 GOTO 460 460 IF X5<1 THEN 510 470 IF X5>15 THEN 510 480 IF Y5<1 THEN 510 490 IF Y5>15 THEN 510 500 GOTO 540 510 PRINT "THAT MOVE TAKES YOU OUT OF THE MAZE." 520 PRINT "MOVE NOT ALLOWED." 530 GOTO 1430 540 ON (A(X5,Y5)+1) GOTO 550,620,630,660,760,800,920 550 REM *** EMPTY SPACE 560 LET A(X,Y)=0 570 LET A(X5,Y5)=1 580 LET X=X5 590 LET Y=Y5 600 PRINT "MOVE ALLOWED." 610 GOTO 1430 620 REM *** IMPOSSIBLE TO GET HERE 630 REM *** BLOCKED SPACE ROUTINE. 640 PRINT "THAT SPACE IS BLOCKED." 650 GOTO 1430 660 REM *** RELOCATION ROUTINE. 670 PRINT "YOU'VE BEEN R E L O C A T E D !!!" 680 GOSUB 2710 690 IF A(Z,W)>2 THEN 540 700 IF A(Z,W) <> 0 THEN 680 710 LET A(Z,W)=1 720 LET A(X,Y)=0 730 LET X=Z 740 LET Y=W 750 GOTO 1430 760 REM *** CHANGE ALL, SUPER TRAP. 770 PRINT " YOU HIT THE SUPER TRAP!! YOU GET A NEW MAZE." 780 GOSUB 1830 790 GOTO 1430 800 REM *** HE WON! 810 PRINT 820 PRINT "I DON'T BELIEVE IT BUT YOU WON THE GAME!" 830 PRINT "YOU GOT TO THE OBJECTIVE BEFORE" 840 PRINT " THE TWONKY GOT YOU!!" 850 PRINT 860 PRINT 870 PRINT "TRY AGAIN (Y/N)"; 880 INPUT Q$ 890 IF Q$="Y" THEN 160 900 IF Q$="N" THEN 2750 910 GOTO 870 920 REM *** HE LANDED ON TWONKY!] 930 PRINT "YOU STEPPED ON THE TWONKY!" 940 GOTO 1790 950 REM *** SHOOT ROUTINE 960 PRINT "WHICH MAY (F/B/R/L)"; 970 INPUT Q$ 980 IF Q$="F" THEN 1030 990 IF Q$="B" THEN 1060 1000 IF Q$="R" THEN 1120 1010 IF Q$="L" THEN 1090 1020 GOTO 210 1030 LET S1=0 1040 LET S2=-1 1050 GOTO 1140 1060 LET S1=0 1070 LET S2=1 1080 GOTO 1140 1090 LET S1=-1 1100 LET S2=0 1110 GOTO 1140 1120 LET S1=1 1130 LET S2=0 1140 LET R1=X 1150 LET R2=Y 1160 LET R1=R1+S1 1170 LET R2=R2+S2 1180 PRINT "Z A P --"; 1190 IF R1 < 1 THEN 1240 1200 IF R1 > 15 THEN 1240 1210 IF R2 < 1 THEN 1240 1220 IF R2 > 15 THEN 1240 1230 GOTO 1280 1240 PRINT "FIZZLE..." 1250 PRINT "SHOT LEFT MAZE." 1260 PRINT "SHOT MISSED." 1270 GOTO 1430 1280 IF A(R1,R2) <>2 THEN 1330 1290 PRINT "BLAST!!!!" 1300 PRINT "YOU HIT WALL." 1310 PRINT "SHOT MISSED." 1320 GOTO 1430 1330 IF A(R1,R2) <> 6 THEN 1160 1340 PRINT " OUCH!!" 1350 PRINT "TWONKY RETREATES." 1360 LET A (R1,R2)=R9 1370 GOSUB 2710 1380 IF A(Z,W) <> 0 THEN 1370 1390 LET A(Z,W)=6 1410 LET X1=Z 1420 LET Y1=W 1430 GOSUB 1450 1440 GOTO 1570 1450 REM *** PRIBNT TWONKY AND OBJECTIVE DISTANCE 1455 PRINT 1460 PRINT "THE TWONKY IS "; 1470 D=(SQR(ABS((X1-X)^2+(Y1-Y)^2))) 1490 PRINT D; 1500 PRINT " UNITS AWAY." 1510 PRINT "THE OBJECTIVE IS "; 1520 D1=(SQR(ABS(X2-X)^2+(Y2-Y)^2)) 1530 PRINT D1; 1540 PRINT " UNITS AWAY." 1550 PRINT 1560 RETURN 1570 REM *** TWONKYS LOGIC 1580 IF D<2 THEN 1790 1590 LET Z2=Y1 1600 LET Z1=X1 1610 IF X < X1 THEN 1680 1620 IF X > X1 THEN 1700 1630 IF Y < Y1 THEN 1660 1640 LET Z2=Y1+1 1650 GOTO 1710 1660 LET Z2=Y1-1 1670 GOTO 1710 1680 LET Z1=X1-1 1690 GOTO 1710 1700 LET Z1=X1+1 1710 LET A(X1,Y1)=R9 1720 LET R9=A(Z1,Z2) 1730 LET A(Z1,Z2)=6 1740 LET X1=Z1 1750 LET Y1=Z2 1760 PRINT "TWONKY MOVES...." 1770 GOSUB 1450 1780 IF D >= 2 THEN 210 1790 PRINT 1800 PRINT "> > > SCHLOORP !!! < < <" 1810 PRINT "THE TWONKY JUST ABSORBED YOU !! YOU LOSE." 1820 GOTO 850 1830 REM *** SET UP NEW MAZE ROUTINE 1840 REM *** 1=PLAYER, 2=BLOCKED SPACES 1850 REM *** 3=RELOCATIONS, 4=SUPER TRAP 1860 REM *** 5=OBJECTIVE, 6=TWONKY 1870 REM *** 0-EMPTY SPACES 1880 REM *** CLEAR MAZE 1883 FOR B0=1 TO 15 1885 FOR B1=1 TO 15 1890 LET A(B0,B1)=0 1893 NEXT B1 1895 NEXT B0 1910 FOR I=1 TO 30 1920 GOSUB 2710 1930 IF A(Z,W) <> 0 THEN 1920 1940 LET A(Z,W)=2 1950 NEXT I 1960 REM *** PLACE RELOCATIONS 1970 FOR I=1 TO 22 1980 GOSUB 2710 1990 IF A(Z,W) <> 0 THEN 1980 2000 LET A(Z,W)=3 2010 NEXT I 2020 REM *** PLACE THE SPECIAL TRAP 2030 GOSUB 2710 2040 IF A(Z,W) <> 0 THEN 2030 2050 LET A(Z,W)=4 2060 REM *** PLACE THE PLAYER 2070 GOSUB 2710 2080 IF A(Z,W) <> 0 THEN 2070 2090 LET A(Z,W)=1 2100 LET X=Z 2110 LET Y=W 2120 REM *** PLACE THE OBJECTIVE 2130 GOSUB 2710 2140 IF A(Z,W) <> 0 THEN 2130 2150 LET A(Z,W)=5 2160 LET X2=Z 2170 LET Y2=W 2180 REM *** PLACE THE TWONKY 2190 GOSUB 2710 2200 IF A(Z,W) <> 0 THEN 2190 2210 LET A(Z,W)=6 2220 LET X1=Z 2230 LET Y1=W 2240 RETURN 2250 REM 2310 PRINT "DO YOU WANT INSTRUCTIONS (Y/N)"; 2320 INPUT Q$ 2330 IF Q$="N" THEN 2700 2340 IF Q$ <> "Y" THEN 2310 2350 PRINT:PRINT:PRINT 2380 PRINT "THIS IS THE GAME OF TWONKY." 2410 PRINT "YOU HAVE LANDED ON THE PLANET OF TWINKY AND" 2420 PRINT "ITS KING (KONG:THEIR KING IS KING KONG) HAS " 2430 PRINT "CAPTURED YOU. HE HAS PUT YOU IN A MAZE THAT IS" 2440 PRINT "15 * 15 UNITS LONG. YOU ARE IN THE DARK AND CANNOT" 2450 PRINT "SEE... YOU MUST GET TO THE OBJECTIVE SQUARE AND" 2460 PRINT "BE SET FREE." 2470 PRINT 2480 PRINT " HAZARDS INCLUDE:" 2490 PRINT "SQUARES THAT YOU CANNOT GO INTO (30)." 2500 PRINT "SQUARES THAT RANDOMLY THROW YOU AROUND THE MAZE (22)." 2510 PRINT "SQUARE THAT SETS UP A NEW MAZE AND ALL THAT'S IN IT (1)" 2520 PRINT "MONSTER CALLED TWONKY THAT CHASES YOU AND WILL" 2530 PRINT " ABSORB YOU IF THE DISTANCE IT IS FROM YOU FALLS" 2540 PRINT " BELOW 2 UNITS." 2550 PRINT " TWONKY IS ALSO IMMUNE TO ALL TRAPS INCLUDING" 2560 PRINT " WALLS." 2570 PRINT 2590 PRINT " YOU CAN:" 2600 PRINT "MOVE ONE SQUARE AT A TIME TO FIND THE OBJECTIVE" 2610 PRINT " OR ESCAPE FRON THE TWONKY." 2620 PRINT "SHOOT AT THE TWONKY ONE DIRECTION AT A TIME." 2630 PRINT " IF THE TWONKY IS HIT, HE WILL BE REPLACED IN THE" 2640 PRINT " MAZE RANDOMLY." 2645 PRINT 2650 PRINT "IF THE TWONKY ABSORBS YOU...YOU LOSE." 2660 PRINT " IF YOU LAND ON THE OBJECTIVE SQUARE YOU WIN." 2670 PRINT 2680 PRINT "GOOD LUCK!" 2690 PRINT 2700 RETURN 2710 REM *** SUBROUTINE TO GET 2 RANDOM NUMBERS 2720 LET Z=INT(RND(1)*15+1) 2730 LET W=INT(RND(1)*15+1) 2740 RETURN 2750 END