Run “javac A3.java”
Run “java A3” If you see “you first, please move”, then you can make moves If you see “AI first, please wait for at most 10 sec”, please wait for the AI to make its first move, it takes a few seconds (depends on the size of the board)
I implement the heuristic algorithm mini-max and alpha-beta-pruning that learned from COMP3190 to decide the next move of AI, given the depth I set for the algorithm, the AI is currently invincible, if markers wants to test with a weaker AI, you can change the depth in the Alpha_beta_pruning class.
The class is made for evaluating the heuristic value of the given board, also can generate and return a board’s valid next-move board.
Change between two AI algorithm can be done by change the comment line in AIPlayer class, getNextMove() function, according to my personal test, alpha-beta-pruning can calculate one more depth comparing with normal min-max in the same time.