solvemind.c
unsigned int evalGuess(Code guess, TurnNode *turnStack, char *possibleCodeBools) {
    unsigned result = 0;
    size_t i = 0;
    Code possibleSecret;
    setCodeToZero(&possibleSecret);
    do {
        if(possibleCodeBools[i]) {

            Response resp = calcResponse(guess, possibleSecret);

            //make temp node on stack
            TurnNode newNode = {{guess, resp}, turnStack};

            unsigned count = countPossibleCodes(&newNode, possibleCodeBools);

            //search for maximum
            if(count > result) result = count;
        }

        i++;
    } while(nextCode(&possibleSecret));

    return result;
}
/*
 * Eval the quality of this possible guess by the worst-case number
 * of possible codes after the guess.
 *
 * This is a good approximation of the common min-max-algo for two player
 * games. It's essentialy doing one turn of min-max and then using the
 * heuristic of optimizing possibility space. Bonus points for using a possible
 * secret code (possibility of winning instantly).
 */
Eval the quality of this possible guess by the worst-case number
of possible codes after the guess.

This is a good approximation of the common min-max-algo for two player
games. It's essentialy doing one turn of min-max and then using the
heuristic of optimizing possibility space. Bonus points for using a possible
secret code (possibility of winning instantly).
Eval the quality of this possible guess by the worst - case number of possible codes after the guess . This is a good approximation of the common min - max - algo for two player games . It ' s essentialy doing one turn of min - max and then using the heuristic of optimizing possibility space . Bonus points for using a possible secret code ( possibility of winning instantly ) .
unsigned int evalGuess(Code guess, TurnNode *turnStack, char *possibleCodeBools) {
    unsigned result = 0;
    size_t i = 0;
    Code possibleSecret;
    setCodeToZero(&possibleSecret);
    do {
        if(possibleCodeBools[i]) {
            Response resp = calcResponse(guess, possibleSecret);
            TurnNode newNode = {{guess, resp}, turnStack};
            unsigned count = countPossibleCodes(&newNode, possibleCodeBools);
            if(count > result) result = count;
        }
        i++;
    } while(nextCode(&possibleSecret));
    return result;
}
unsigned int evalGuess ( Code guess , TurnNode * turnStack , char * possibleCodeBools ) { unsigned result = 0 ; size_t i = 0 ; Code possibleSecret ; setCodeToZero ( & possibleSecret ) ; do { if ( possibleCodeBools [ i ] ) { Response resp = calcResponse ( guess , possibleSecret ) ; TurnNode newNode = { { guess , resp } , turnStack } ; unsigned count = countPossibleCodes ( & newNode , possibleCodeBools ) ; if ( count > result ) result = count ; } i ++ ; } while ( nextCode ( & possibleSecret ) ) ; return result ; }
Eval the quality of this possible guess by the worst-case number
 of possible codes after the guess.
Eval the quality of this possible guess by the worst - case number of possible codes after the guess .
//make temp node on stack //search for maximum