Tic-Tac-Toe game using the Monte Carlo Tree Search algorithm, implemented in Java.
https://github.com/SanchithHegde/tic-tac-toe.git
Tic-Tac-Toe game using the Monte Carlo Tree Search algorithm, implemented in Java. The MCTS algorithm makes the computer almost impossible to beat, thus the worst case scenario (for the computer) would be a draw.
# Compile all files
$ javac src/me/sanchithhegde/tictactoe/*.java -d target/classes
# Execute driver class' main method
$ java -classpath target/classes me.sanchithhegde.tictactoe.App
target/classes can be replaced with any directory of your choice. If you do change the output directory, make sure to specify the same directory when running the app.
1 2 3
4 5 6
7 8 9
-'.O's.X's.Monte Carlo tree search - Wikipedia
Monte Carlo Tree Search for Tic-Tac-Toe Game - Baeldung
Feel free to submit pull requests or open issues. Please ensure you follow Google's Java Style Guide when making pull requests. Use Checkstyle with your editor if required.