A small project created by Thomas Sørensen and Ludvig Øvrevik during our first year at NTNU Trondheim.
This is a JavaFX-based Connect four game with an option to play against the Monte Carlo Tree Search (MCTS) algorithm. The project was created as part of an object-oriented programming course in our first year, while the MCTS was a fun side project since we were also implementing AlphaZero. The game is built using Java and JavaFX, and includes an intuitive user interface.
- Play Connect four against another player or an AI opponent (MCTS).
- Interactive Graphical User Interface (GUI) built with JavaFX.
- Responsive board with real-time updates.
- Simple, easy-to-use controls.
Ensure you have the following installed:
- Java 17+ (required for JavaFX support)
- Git (for cloning the repository)
Open a command prompt (cmd) and navigate to the project folder:
cd path\to\projectRun the game using the batch script:
run-windows.bat
Open a terminal and navigate to the project folder:
cd path/to/projectGive execution permission (only needed once):
chmod +x run.sh
Run the game:
./run.sh
MCTS simulates 1000 games every time it's the algorithms turn. You can see how it choose its move in the terminal. You can increase or lower the amount of simulation to make the algorithm better or worse respectively.
Feel free to fork the repository and submit pull requests! If you find a bug, create an issue on GitHub or GitLab.
This project is licensed under the MIT License.
