A Java implementation of the classic Gomoku (Five in a Row) strategy board game.
-
Game Modes: Player vs Player, Player vs Computer.
-
Save & Load: Save your current game and resume later.
-
Customizable Rules: Configurable board size (default 15×15, max 30×30) and win condition (default 5 in a row).
-
Console Interface: Interactive command-line menus.
-
Minimax Algorithm: The computer player uses the Minimax algorithm with Alpha-Beta pruning to choose the best move.
graph TD
A["chosePlacement()"] --> B["getFeasibleMoves()"]
B --> C["For each move: simulate → minimax → undo"]
C --> D{"Depth=0 or terminal?"}
D -- Yes --> E["evaluateBoard()"]
D -- No --> F["Alpha-Beta pruning"]
F --> C
Gomoko/
├── src/ # Java source files
├── bin/ # Compiled .class files (generated)
├── SavedGames/ # Saved game files
├── Gomoku.jar # Executable JAR (generated)
├── Makefile # Build script (Linux/macOS or Windows with make)
├── build.bat # Build script (Windows)
└── README.md
- Java Development Kit (JDK) 17 or later.
build.bat compile REM Compile sources
build.bat run REM Compile + run the game
build.bat jar REM Create clickable Gomoku.jar
build.bat clean REM Remove bin/ and Gomoku.jarmake compile # Compile sources
make run # Compile + run
make jar # Create clickable JAR
make clean # Clean upjavac -d bin src/*.java
java -cp bin src.MainDouble-click Gomoku.jar, or from a terminal:
java -jar Gomoku.jar- ELNASORY Karam
- Jean-Baptiste LARGERON
- Syrine BEN HASSINE