I have stolen an isvisible method from the c# bot

bool isVisible(Loc loc){
 Loc[] offsets;
int squares = cast(int)floor(sqrt(_viewradius2));
for (int r = -1 * squares; r <= squares; ++r){
for (int c = -1 * squares; c <= squares; ++c){
int square = r * r + c * c;
if (square < _viewradius2){
Loc newLoc = {r,c};
offsets~=newLoc;
}
}
}
foreach (ant;_myAnts)
{
foreach (offset;offsets)
{
if ((ant.col + offset.col) == loc.col &&
(ant.row + offset.row) == loc.row)
{
 return true;
}
}
}
return false;
 }

But I have also lost interest because of a couple of shortcommings, the
hell it is to debug that thing and when it finally compiles fine on 2
machines it gives a cryptic error about glue.c (that had something to do
with rdmd)

Reply via email to