This is a classic Gomoku (also known as Five in a Row) game implemented in Java with a graphical user interface (GUI) and an AI opponent.
- Graphical User Interface: The game is built with Java Swing, providing a visual and interactive game board.
- Player vs. AI: Play against an AI opponent that uses the minimax algorithm with alpha-beta pruning to determine its moves.
- Game Controls: A simple control panel allows you to restart the game at any time.
-
Prerequisites:
- Java Development Kit (JDK) installed.
-
Compilation: Open a terminal or command prompt, navigate to the
srcdirectory, and compile the Java files:javac *.java -
Execution: After successful compilation, run the application from the
srcdirectory:java App
The project is organized into the following Java files within the src directory:
App.java: The main class that launches the application.GameFrame.java: The main window for the game, containing the game panel and control panel.GamePanel.java: The panel that displays the Gomoku board and handles player input.ControlPanel.java: The panel with game controls, such as a "Restart" button.AI.java: Implements the logic for the computer opponent, using an AI algorithm to make intelligent moves.