



SingleBestGuess (lines 3430-3443)
Back to List
Browsing parserm.h
3430 ! SingleBestGuess returns the highest-scoring object in the match list
3431 ! if it is the clear winner, or returns -1 if there is no clear winner
3432 ! ----------------------------------------------------------------------------
3433
3434 [ SingleBestGuess earliest its_score best i;
3435 earliest = -1; best = -1000;
3436 for (i=0 : i<number_matched : i++) {
3437 its_score = match_scores-->i;
3438 if (its_score == best) earliest = -1;
3439 if (its_score > best) { best = its_score; earliest = match_list-->i; }
3440 }
3441 bestguess_score = best;
3442 return earliest;
3443 ];
Last updated 27 February 2004. The librarian in charge of this page is Graham Nelson (graham@gnelson.demon.co.uk) assisted by C Knight. Please email any comments, suggestions or corrections to cedenqs@inform-fiction.org.