1 DIM K$(1):DIM Y$(13):Y$="FINAL SCORE: ":DIM U$(13):U$="HIGH SCORE:  ":B=0:S=0:H=100:P=4:E=100:GOTO 9

2 OPEN #5,4,0,"K:":I=PEEK(764):IF I=255: CLOSE #5:GOTO 2:ENDIF:GET #5,I:CLOSE #5:K$=CHR$(I):RETURN

3 PR.:PR."HEALTH: ";H:PR."SCORE: ";S:PR."POTIONS: ";P:PR.:PR. "(A)TTACK OR (H)EAL?":D=RAND(48):M=RAND(25)

4 GOSUB 2:IF K$="H" AND P>0 THEN Z=D+M:H=H+Z:PR."HEALED FOR ";Z;" HIT POINTS":P=P-1

5 IF K$="A" THEN E=E-D:H=H-M:PR.:PR."YOU DID ";D;" DAMAGE, BUT WERE HIT FOR ";M:IF D>40 THEN 10

6 IF E<1 AND H>0 THEN PR.:PR."YOU HAVE DEFEATED THE GRUE!":S=S+100:E=100:IF D>40 THEN P=P+1:PR."FOUND A POTION!"

7 IF H<1 THEN PR.:PR."SORRY, YOU DIED!":PR.Y$;S:PR.U$;B:GOSUB 2:S=0:H=100:P=4:E=100:GR.0:SE.2,0,0:GOTO 9

8 IF H>99: H=100:ENDIF:PR.:PR."PRESS ANY KEY TO CONTINUE":GOSUB 2

9 IF S>B:B=S:ENDIF:GR.0:SE.2,0,0:PR."IT IS PITCH BLACK.":PR."YOU ARE LIKELY TO BE EATEN BY A GRUE.":GOTO 3

10 PR. "CRITICAL HIT!":SE.2,3,4:SO.0,150,8,4:FOR L=1 TO 499:NEXT L:SOUND 0,0,0,0:SE.2,0,0:GOTO 6



Variable List:

K$= (KEYBOARD CHR)

Y$= "FINAL SCORE: "

U$= "HIGH SCORE:  "

S = SCORE

B = BEST SCORE

H = HEALTH (100 MAX)

P = #POTIONS (POTIONS DROPPED ON CRITICAL HIT KILL)

Z = AMOUNT HEALED BY POTION (D+M VALUE)

E = ENEMY HEALTH

I = INKEY VALUE

D = DAMAGE ROLL (41+ IS CRITICAL HIT)

M = DAMAGE ENEMY DOES

L = SOUND LOOP