-
Notifications
You must be signed in to change notification settings - Fork 0
/
ohrats.bas
11 lines (11 loc) · 1023 Bytes
/
ohrats.bas
1
2
3
4
5
6
7
8
9
10
11
#DEFINE D #DEFINE
D O(V) FOR Y=1 TO E:FOR X=1 TO W:V:NEXT:NEXT
D T THEN
D EI END IF
D C CASE
D Z(V) COLOR(V,0)
D K M(X,Y)
D M3(V) 2+RND*(V-3)
D N AND
SCREEN 9:RANDOMIZE TIMER:DIM SHARED AS SHORT W=80,E=24,A,B,Y,X,M(W,E),I,J,L,H=50,Q,F=46,S=62,P,R=114,G,U(R):U(35)=15:U(F)=6:U(S)=2:U(R)=7:SUB NL:O(K=F):O(IF X=1 OR X=W OR Y=1 OR Y=E OR INT(RND*15)=1 T K=35:EI):B=L+15+RND*15:FOR A=1 TO B:M(M3(W),M3(E))=R:NEXT:A=M3(W):B=M3(E):M(A,B)=S:I=M3(W):J=M3(E):O(IF X>1 N Y>1 N X<W N Y<E N X<>A N K=35 N(X=I OR Y=B)T:K=F:EI):L+=1:END SUB:SUB HK:A=I:B=J:SELECT C GETKEY:C 53 N M(A,B)=S:NL:RETURN:C 52:A-=1:C 56:B-=1:C 54:A+=1:C 50:B+=1:C 27:Q=1:END SELECT:P=M(A,B):IF(P=F OR P=S OR P=R)T I=A:J=B:IF P=R T M(A,B)=F:G+=L EI:O(IF K=R T:A=(X+SGN(I-X)):B=(Y+SGN(J-Y)):P=M(A,B):IF P=F OR P=R T:K=F:M(A,B)=5:IF A=I N B=J T H-=1:M(A,B)=F EI:EI:EI):O(IF K=5 T K=R:EI):IF H<=0 T Q=1
END SUB:NL:DO:CLS:O(P=K:Z(U(P)):? CHR(P);):? "HP";H;" LVL";L;" SCORE";G;:Z(9):LOCATE J,I:? "@":Z(15):HK:LOOP UNTIL Q=1:CLS:? "Level";L;" Score";G:GETKEY