Algorithm: Minimax algorithm with alpha-beta pruning
File description:
- main.java: Main function with several user inputs
- Board.java: Board information
- MiniMaxAgent.java: Minimax algorithm with alpha-beta pruning
- Point_score.java: Evaluation function
- pre_random_move.java: Random move function
- The program will ask the user for giving the time limit and the depth for the minimax algorithm with alpha-beta pruning.
- The user can decide who go first, Computer (AI) or Opponent (Human).
The evaluation function consider all the cases include:
- Line of two: _ XX _, XX _, XX, X_X, X_X, _X_X, ...
- Line of three: _ XXX _, XXX _, XXX, X_XX, XX_X, _X_XX, ...
- Line of four: Winning case.
- Block one:
- Meet the limit of the board: _XXX|
- Meet the opponent: _XXO
- Block two: O_XXX|, O_XXXO, OXX_X|, ...
- No empty space: XXX, _XXX, XXX, ...
- Empty space at position [1]: X_XX, _X_XXX, ...
- Empty space at position [2]: XX_X, _XX_XX, ...
- Empty space at position [3]: XXX_X, _XXX_X, ...
Decide the value for each cases depend on the situation list above. Keep changing the value for each cases to see which value works better in the games.
This project is licensed under the MIT License - see the LICENSE.md file for details
- Author: Hank Tsou
- Contact: [email protected]
- Project from California State Polytechnic University, Pomona, Computer Science, CS-4200 Artificial Intelligence