A strategic board game implementation with AI players using Minimax and Alpha-Beta pruning algorithms using Prolog.
Hex is a two-player abstract strategy board game in which players attempt to connect opposite sides of a rhombus-shaped board made of hexagonal cells. The game was invented by mathematician and poet Piet Hein in 1942 and later rediscovered and popularized by John Nash.
Learn more about Hex on Wikipedia
- ✨ Two-player support for any board dimension
- 🔄 Refactored game loops with configurable first player
- 🧠 Minimax algorithm implementation
- 🧮 Alpha-Beta pruning optimization
- 🤖 CPU vs CPU gameplay option
- ✅ Tested configurations:
- 2x2 board
- 3x3 board
- 4x4 board (with Alpha-Beta)
- After 5x5 board, AI takes too long to make a move
- SWI-Prolog (version 9.0.0 or higher recommended)
swipl .\hex.plswipl .\tests\test_dfs.plswipl .\tests\test_minimax.plswipl .\tests\test_alphabeta.pl