+ nhighscores_absolute= atoi(*argv++);
+ nhighscores_perleague= atoi(*argv++);
+ const char *final_isle_spec= *argv++;
+
+ MCALLOC(highscores_absolute, nhighscores_absolute);
+ MCALLOC(highscores_perleague, nhighscores_perleague);
+
+ int resultsix= 0;
+ while ((arg= argv[resultsix])) {
+ int init_isle= atoi(arg);
+
+ int final_isle;
+ if (!strcmp(final_isle_spec,"circ")) final_isle= init_isle;
+ else if (!strcmp(final_isle_spec,"any")) final_isle= -1;
+ else final_isle= atoi(final_isle_spec);
+ assert(final_isle);
+
+ search(init_isle, final_isle, &results[resultsix]);
+ resultsix++;
+ }
+
+ int i, midarch, finarch;
+ for (i=0; i<resultsix; i++) {
+ tabdebugf("============== start #%d %s [PARTIAL] ==============\n",
+ i, argv[i]);
+ PotentialResult ***strat_resultsix= results[i];
+ if (!strat_resultsix) continue;
+ tabdebugf(" ");
+ for (midarch=0; midarch<narches; midarch++) {
+ tabdebugf("| mid %d ",midarch);
+ }
+ tabdebugf("\n");
+ for (finarch=0; finarch<narches; finarch++) {
+ PotentialResult **strat_finarch= strat_resultsix[finarch];
+ if (!strat_finarch) continue;
+ tabdebugf("f%d",finarch);
+ for (midarch=0; midarch<narches; midarch++) {
+ PotentialResult *result= strat_finarch[midarch];
+ if (!result) {
+ tabdebugf("| ");
+ } else {
+ tabdebugf("|%5d",(int)(result->absolute));
+ tabdebugf(" ");
+ tabdebugf("%4d",(int)(result->perleague));
+ }
+ }
+ tabdebugf("\n");
+ }
+ }
+
+ int pos;
+#define OUT(absperl) \
+ fprintf(output,"\n================== " #absperl " ==================\n"); \
+ for (pos=0; pos<nhighscores_##absperl; pos++) { \
+ HighScoreEntry *hs= &highscores_##absperl[pos]; \
+ PotentialResult *pr= hs->pr; \
+ if (!pr) continue; \
+ const int *const ports= pr->absperl##_ports; \
+ int nports; \
+ for (nports=0; nports<MAX_ROUTELEN && ports[nports]>=0; nports++); \
+ int finisle= ports[nports-1]; int finarch= isle2arch(finisle); \
+ int midarch= route2midarch(ports,nports); \
+ fprintf(output, \
+ " @%2d #%2d | start%3d mid%d f%d:%3d | %5d %5d %4d |", \
+ pos, nhighscores_##absperl - 1 - pos, \
+ ports[0], midarch, finarch,finisle, \
+ (int)hs->value, (int)pr->absolute, (int)pr->perleague); \
+ for (i=0; i<nports; i++) fprintf(output," %d",ports[i]); \
+ fprintf(output,"\n"); \
+ }
+ OUT(absolute)
+ OUT(perleague)
+ fprintf(output,"\n");
+