5 RANDOMIZE
10 LV =1
20 OPEN "I",#1,"HISC.DAT":INPUT #1,HS,HS$,G2,I2$,G3,I3$:CLOSE #1
30 GOSUB 1000
40 LR=INT(RND*2):PA=0:GOSUB 260
50 ST$=INKEY$:IF ST$<>"A"THEN GOTO 50
60 FOR T =1 TO 200:NEXT
70 A$=INKEY$
80 IF A$="A"THEN PL=P:P=P-128
90 IF A$="Z"THEN PL=P:P=P+128
100 IF A$=","THEN PL=P:P=P-1
110 IF A$="."THEN PL=P:P=P+1
120 IF P<61440! THEN PL=P+128:P=P+3072
130 IF P>64512! THEN PL=P-128:P=P-3072
140 C= (P-61440!)/128:IF C-INT(C)= .40625 THEN PL=P-1:P=P-51
150 L=(P-61440!)/128:IF L-INT(L)<.001 THEN PL=P+1:P=P+51
160 IF PEEK(P)=141 THEN GOSUB 230
170 IF PEEK(P)=127 THEN SC=SC-100
180 IF PEEK(P)=42 THEN GOTO 530
190 POKE PL,32:POKE P,140
200 IF INT(RND*2)=1 THEN GOSUB 320
210 SC=SC-1
220 GOTO 70
230 JG=JG+1:SC=SC+100
240 IF JG=20 THEN GOTO 460
250 RETURN
260 K$=INKEY$:PRINT CHR$(26);:PRINT"LEVEL";LV;"   HIT <A> WHEN READY TO BEGIN";:FOR T = 1 TO 2000:NEXT
270 PRINT CHR$(26);:P=62872!:PL=P:POKE P,140:BP=62873!:PP=BP:POKE BP,42
280 FOR Z=1 TO 20
290 X=61440!+128*INT(24*RND):Y=INT(RND*51)+1:IF PEEK(X+Y)=141 THEN 290 ELSE POKE X+Y,141
300 NEXT:RETURN
320 M=INT(RND*4)
330 IF LR=0 THEN IF M=3 THEN PP=BP: BP=BP+1
340 IF LR=1 THEN IF M=3 THEN PP=BP: BP=BP-1
350 IF M=2 THEN PP=BP: BP=BP-128
360 IF M=1 THEN PP=BP: BP=BP+128
370 IF BP =LP THEN BP=PP:GOTO 320
380 IF BP<61440! THEN PP=BP+128:BP=BP+3072
390 IF BP>64512! THEN PP=BP-128:BP=BP-3072
400 BC=(BP-61440!)/128:IF BC-INT(BC)= .40625 THEN PP=BP-1:BP=BP-51
410 BL=(BP-61440!)/128:IF BL-INT(BL)<.001 THEN PP=BP+1:BP=BP+51
420 IF PEEK(BP)=141 OR PEEK(PP)=141  THEN JG=JG+1:FOR B=1 TO 100:PRINT CHR$(7);:NEXT:IF LV=1 THEN SC=SC-(50+LV*25)
430 IF JG = 20 THEN GOTO 460 ELSE POKE PP,127:POKE BP,42
440 LP=PP
450 RETURN
460 IF SC >LV*1600 THEN LV=LV+1:PA=1
470 JG=0:IF SC > HS THEN HS=SC:GOSUB 540
480 PRINT CHR$(26):PRINT"SCORE"SC;"     HIGH SCORE"HS;" - "HS$
490 FOR T = 1 TO 3000:NEXT
500 IF PA=1 THEN PRINT"BONUS LEVEL":FOR T=1 TO 1000:NEXT:GOTO 40
510 K$=INKEY$:INPUT"PLAY AGAIN?",RP$:IF RP$="Y"THEN SC=0:LV=1::GOTO 40
520 GOTO 560
530 PRINT CHR$(26):PRINT "SORRY, YOU GOT EATEN":FOR T=1 TO 2000:NEXT:GOTO 470
540 PRINT CHR$(26):PRINT"YOU GOT HIGH SCORE":INPUT"INITIALS",HS$
550 OPEN "O",#1,"HISC.DAT":WRITE #1,HS,HS$,G2,I2$,G3,I3$:CLOSE#1:RETURN
560 PRINT CHR$(26):PRINT"GAME OVER":END
1000 PRINT CHR$(26):PRINT"                   GUARDIAN"
1010 PRINT"YOU ARE THE GUARDIAN OF THE INSECTS.  YOUR TASK"
1020 PRINT"IS TO RESCUE 20 INSECTS WHICH ARE CAUGHT IN THE"
1030 PRINT"SPIDER'S WEB.  YOU MOVE ABOUT PICKING UP 100 POINTS"
1040 PRINT"FOR EACH INSECT YOU RESCUE.  THE SPIDER IS  ALSO"
1050 PRINT"MOVING ABOUT SUBTRACTING POINTS FROM YOUR SCORE"
1060 PRINT"FOR EACH INSECT HE EATS.  IF YOU CROSS THE SPIDER'S"
1070 PRINT"WEB YOU LOSE 100 POINTS AND IF YOU TOUCH THE"
1080 PRINT"SPIDER YOU DIE AND THE GAME ENDS.  POINTS ARE"
1090 PRINT"SUBTRACTED FOR THE TIME TAKEN TO CLEAR THE SCREEN"
1100 PRINT"SO EFFICIENCY IS IMPORTANT.  IF YOU RESCUE ENOUGH"
1110 PRINT"ENOUGH INSECTS TO SCORE 1600 OR BETTER YOU WILL BE"
1120 PRINT"GIVEN 20 MORE INSECTS TO PROTECT.":PRINT:PRINT
1130 PRINT"      MOVEMENT                ";CHR$(140);" YOU":PRINT
1140 PRINT"     UP (A)                   ";CHR$(141);" INSECTS":PRINT
1150 PRINT"LEFT (<)   (>) RIGHT          ";CHR$(42); " SPIDER":PRINT
1160 PRINT"   DOWN (Z)                   ";CHR$(127);" SPIDER'S WEB":PRINT
1200 INPUT"PRESS RETURN WHEN READY";AN:PRINT CHR$(26):RETURN
   DO