anchor.diff:  //Length as straight and diagonal
   function KMLength(A,B:TKMPoint): single;
   begin
  -if abs(A.X-B.X) > abs(A.Y-B.Y) then
  -  Result := abs(A.X-B.X) + abs(A.Y-B.Y)*0.41
  -else
  -  Result := abs(A.Y-B.Y) + abs(A.X-B.X)*0.41
  +  if abs(A.X-B.X) > abs(A.Y-B.Y) then
  +    Result := abs(A.X-B.X) + abs(A.Y-B.Y)*0.41
  +  else
  +    Result := abs(A.Y-B.Y) + abs(A.X-B.X)*0.41
   end;
   
   
  
positive.code: 
  {TypeToString routines}
  function TypeToString(t:TUnitType):string;
  var s:string;
  begin
    case byte(t) of
      1..30: s := fTextLibrary.GetTextString(siUnitNames+byte(t));
      31:    s := 'Wolf';
      32:    s := 'Fish';
      33:    s := 'Watersnake';
      34:    s := 'Seastar';
      35:    s := 'Crab';
      36:    s := 'Waterflower';
      37:    s := 'Waterleaf';
      38:    s := 'Duck';
      else   s := 'N/A';
    end;
    Result := s;
  end;
  
  
  function TypeToString(t:THouseType):string;
  var s:string;
  begin
  if byte(t) in [1..HOUSE_COUNT] then
    s:=fTextLibrary.GetTextString(siHouseNames+byte(t))
  else
    s:='N/A';
  Result:=s;
  end;
  
  
  function TypeToString(t:TResourceType):string;
  var s:string;
  begin
  if byte(t) in [1..28] then
    s:=fTextLibrary.GetTextString(siResourceNames+byte(t))
  else
    s:='N/A';
  Result:=s;
  end;
  
  
  function TypeToString(t:TKMPoint):string;
  begin
    Result:='('+inttostr(t.x)+';'+inttostr(t.y)+')';
  end;
  
  
  function TypeToString(t:TKMDirection):string;
  begin
    Result:=TKMDirectionS[byte(t)];
  end;
  
  end.
  
negative.code:     exit;
    end;
  
    //Find ring in which Index is located
    Ring := 0;
    repeat inc(Ring); until(Rings[Ring]>aIndex);
  