1 REM *** Written by Mark Ray, please read welcome.msg first ***
2 ON ERROR IF ERR=17 THEN CH."AUTO" ELSE REPORT:PRINT " at ";ERL:END
5 CLS:PRINTSPC(35);"BLOCK GAME"''SPC(28);"Left:F Down:V Right:G"
6 PRINT'''SPC(29);"Press any key to start";GET
10 TDL=50:SC=0:A=RND(-TIME):CLS
30 REPEAT:TYPE=RND(15):X=39:Y=0:FIN=FALSE:PROCdisp(X,Y)
40 REPEAT:K$=INKEY$(TDL):PY=Y-(INSTR("FG",KPROeras(X,Y):PX=X+(K$="F")-(K$="G"):IF FNok2go2(PX,Y) THEN X=PX
60 IF FNok2go2(X,PY) THEN Y=PY ELSE FIN=TRUE
70 PROCdisp(X,Y):UNTIL FIN:CHK=0
80 FORL=1TO7:CHK=CHK+FNcheck(L):NEXT
85 TDL=TDL*0.9:SC=CHK:PRINT TAB(0,0);"Score:";SC
90 UNTIL FNcheck(0):CHK=GET:CHAIN"AUTO"
100DEF FNcheck(L):LOCAL C:C=0
110FOR XC=31TO49:C=C-FNpt(XC,L):NEXT:=C
120DEFFNok2go2(X,Y):LOCAL OK:OK=TRUE
130FOR XC=0TO1:FOR YC=0TO1
140IFFNpt(XC+X,YC+Y) AND FNblk(XC,YC) THEN OK=FALSE
150NEXT:NEXT:=OK
160DEF PROCdisp(X,Y)
170FOR XC=0TO1:FOR YC=0TO1
180IFFNblk(XC,YC) THEN VDU 31,X+XC,Y+YC,219
190NEXT:NEXT:ENDPROC
200DEF PROCeras(X,Y)
210VDU 14:PROCdisp(X,Y):VDU 15:ENDPROC
220DEF FNpt(X,Y):=(POINT((6*X)+3,(8*(7-Y))+4)<>0)
230DEF FNblk(X,Y):=(TYPE AND(2^(Y*2+X)))