Code in the .c file that is relevant:
Code:
static GrowListEntry BZNA_GetBest(BecStruct *bzs);
static GrowListEntry BZNA_GetBest(BecStruct *bzs)
{
int i;
int MaxI, MaxScore;
GrowListEntry RetVal;
MaxScore = -1;
for (i = 0; i < bzs->GrowListCount; i++)
{
if (bzs->GrowList[i].Score > MaxScore)
{
MaxI = i;
MaxScore = bzs->GrowList[i].Score;
/* MaxScore is the first variable that differs on second run */
ti_record_time("MaxScore %i", MaxScore);
}
}
/* hang on to best */
RetVal = bzs->GrowList[MaxI];
/* move last slot to emptying best slot and decrement count */
bzs->GrowList[MaxI] = bzs->GrowList[--bzs->GrowListCount];
return RetVal;
}
code in the .h file that is relevant:
Code:
typedef struct tag_GrowListEntry
{
unsigned short Score;
signed char X;
signed char Y;
} GrowListEntry;
typedef struct tag_BecStruct
{
GrowListEntry GrowList[2851];
int GrowListCount;
} BecStruct;
extern void *ti_record_time(const char *string,... );