FUNCTION SUROUND,pos1,pos2,surr,sx ;A subroutine for RECUR. ;POS1, POS2 are positions in a 2-D frame with x-dim=SX ;in the 1-D representation. ;SURR defines a size of surroundings of POS1 ;(if SURR=1 then surroundings is 3x3, if SURR=2 then 5x5 etc.) ;If POS2 is in the surroundings of POS1 then SURROUND returns 1, ;otherwise it returns 0 (byte). rrus=surr*(-1) for j=rrus,surr do begin for i=rrus,surr do begin if (pos1+j*sx+i) eq pos2 then RETURN,1B endfor endfor RETURN,0B END