Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void search(State state, List<Action> actionsList, Turn turn) {
- State newState;
- double score;
- for (Action action : actionsList) {
- newState = applyAction(state, action);
- turn.actions.add(action);
- while (newState.phase != null) {
- search(newState, getAllActions(newState), turn);
- }
- score = calcScore(newState);
- if (score > maxScore) {
- maxScore = score;
- bestTurn = turn.duplicate();
- }
- turn.actions.remove(turn.actions.size() - 1);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement