Pawn
Captures Wyvern: How Computer Chess Can Improve Your Pathfinding
Listing
3. The Code For The Algorithm That Drives IDA*
int ComputeNumberOfMoves(position
startposition)
{
int fmax; /* maximum
distance to search */
int bFoundPath = FALSE;
fmax
= EstimateDistanceToGoal(startposition);
while (bFoundPath == FALSE)
{
bFoundPath = IDAStar(startposition);
if (bFoundPath == FALSE)
{ fmax += 1; }
}
return fmax;
}
___________
Back
to Article