Random game
Random game
Random game
Bagh Chal
Listing 1
10 GRAPHICS 2:​DIM B$(45):​B$="t- - - -t!\!/!\!/! - - - - !/!\!/!\!012321230":​? #6;" ":​FOR I=37 TO 45:​N=(VAL(B$(I,​I))*9)+1
20 IF I MOD 2=1:​? #6;CHR$((I-37)/2+177);:​ELSE:​? #6;" ";:​ENDIF:​? #6;B$(N,​N+8):​NEXT I:​G=20:​DIM I$(2):​Q=1000
100 REPEAT:​? K;" T from":​GOSUB Q:​UNTIL C=116:​X1=X:​Y1=Y:​REPEAT:​? "T to":​GOSUB Q:​DX=ABS(X1-X):​DY=ABS(Y1-Y)
105 OK=(C=32 AND (DX=DY OR X1=X OR Y1=Y) AND DX<3 AND DY<3 AND (((X1+Y1) MOD 2)=0 OR X1=X OR Y1=Y))
110 IF DX=2 OR DY=2:​GX=(X1+SGN(X-X1))*2+1:​GY=(Y1+SGN(Y-Y1))*2+1:​LOCATE GX,​GY,​C1:​IF C1<>231:​OK=0:​ENDIF:​ENDIF:​UNTIL OK
120 C=116:​GOSUB 2000:​IF G>0:​REPEAT:​? G;" G at":​GOSUB Q:​UNTIL C=32:​POSITION X*2+1,​Y*2+1:​? #6;"":​G=G-1:​ELSE
140 REPEAT:​? "G from":​GOSUB Q:​UNTIL C=231:​X1=X:​Y1=Y:​REPEAT:​? "G to":​GOSUB Q:​DX=ABS(X1-X):​DY=ABS(Y1-Y)
150 OK=(C=32 AND DX<2 AND DY<2 AND (((X1+Y1) MOD 2)=0 OR X1=X OR Y1=Y)):​UNTIL OK:​C=231:​C1=0:​GOSUB 2000:​ENDIF:​GOTO 100
1000 TRAP Q:​REPEAT:​INPUT I$:​X=ASC(I$(1,​1))-65:​Y=ASC(I$(2,​2))-49:​UNTIL X>=0 AND X<6 AND Y>=0 AND Y<6:​LOCATE X*2+1,​Y*2+1,​C:​TRAP 32768:​RETURN
2000 POSITION X1*2+1,​Y1*2+1:​? #6;" ":​POSITION X*2+1,​Y*2+1:​? #6;CHR$(C):​IF C1=231:​POSITION GX,​GY:​? #6;" ":​K=K+1:​ENDIF:​RETURN	

This is non-commercial site, its content is based on Atari 8-bit home computer contents and references.
If you feel your rights are violated by showing/using any part of contents of your product represented on this page, please contact me immediatelly so I can remove it!