Program listing on 48K Spectrum
Important note on the above listings
Due to limited space available in the above program listings, the method of keyboard reading is very simple, and does not mask off the 'ear' bit. Therefore the value of 'n' used to compare against the IN command (found at the very end of the program listing) may have to be changed to either 191 or 255 depending on the issue of the ZX spectrum in use, the internal state of a snapshot file, or the emulator and settings in use. Otherwise the keyboard may not respond.
1 DIM i$(3,7): FOR g=1 TO 3: LET i$(g)=" H H H": NEXT g: READ m,b,p,a,s,e,n: FOR y=0 TO 13: FOR x=e TO 26-e STEP 1-e/13: FOR i=1 TO 3: PRINT AT y-1+2*i,x,'TAB x;i$(i): NEXT i: LET z=(b>y)*(b<y+7)*(a>x)*(a<x+7): LET k=1+z*(b-y-2)/2: LET l=1+z*(a-x): LET h=i$(k,l)>" ": LET q=(b=1)*(m>0)*2>ABS (a-m): PRINT AT 0,m;"<=>" AND m,,AT g-1,x+3;" ";AT g,x+4;"*";AT 21,0;s,,AT b+1,a;" ";AT b,a;"|" AND b-b*h;AT 20,p-1;" W ": IF x+3-p+g/20 THEN LET i$(k,l)="": LET s=s+h+5*q: LET p=p-(IN 64510<n)*(p>1)+(IN 57342<n)*(p<30): LET b=(1-h)*(b+19*(IN 32766<n)*(b=0)-(b>0)): LET a=a+(p-a)*(b=19): LET g=1+g+(g=21)*(y+4-g): LET m=(q=0)*(m-(m>0)): LET e=x: NEXT x: LET m=m+29*(e+RND<.5): NEXT y: DATA 0,0,14,p,0,26,255 |
Rules of the Game