Created
November 1, 2012 18:09
-
-
Save Hydrotoast/3995461 to your computer and use it in GitHub Desktop.
General Approach for Adversarial Search
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int AI::IterativeDeepening(const State& state, int alpha, int beta, int depth) { | |
if (cutoff(state, depth)) | |
return eval(state); | |
int result = 0; | |
for (Move* move : moves) { | |
State newState = state.clone(); | |
result = max(result, newState.makeMove(state)); | |
} | |
return result; | |
} | |
bool AI::cutoff(const State& state, int depth) { | |
return state->isEndGame() || depth == 0; | |
} | |
// TODO: Implement this | |
int AI::eval(const State& state) { | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment