long int eval (const int white_to_move, const int white_castled, const int black_castled, const int wking_loc, const int bking_loc, int board[], int moved[], int pieces[], const int num_pieces, const long piece_count, const long start_piece_count) { /* select the appropriate eval() routine: */ if (piece_count > 11) { return (opn_eval (white_to_move, white_castled, black_castled, wking_loc, bking_loc, board, moved, pieces, num_pieces)); } else if (piece_count < 5) { return (end_eval (white_to_move, board, pieces, num_pieces, piece_count, start_piece_count)); } else { return (mid_eval (white_to_move, white_castled, black_castled, wking_loc, bking_loc, board, moved, pieces, num_pieces, piece_count, start_piece_count)); } }
long int eval (void) { long int score = 0; /* select the appropriate eval() routine: */ if (piece_count > 11) { if (_default_PStables) score = score + opn_eval_tables(); score = score + (opn_eval() / _centipawn_value); return score; } else if (piece_count < 5) { if (_default_PStables) score = score + end_eval_tables(); score = score + (end_eval() / _centipawn_value); return score; } else { if (_default_PStables) score = score + mid_eval_tables(); score = score + (mid_eval() / _centipawn_value); return score; } }