Skip to content

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🎮 Hex Game

A strategic board game implementation with AI players using Minimax and Alpha-Beta pruning algorithms using Prolog.

🎲 About the Game

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

📋 Features

Version 1.0.0

  • ✨ 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

📋 Requirements

  • SWI-Prolog (version 9.0.0 or higher recommended)

🚀 Getting Started

Run the Game

swipl .\hex.pl

Tests

DFS Test

swipl .\tests\test_dfs.pl

MiniMax Test

swipl .\tests\test_minimax.pl

AlphaBeta Test

swipl .\tests\test_alphabeta.pl

About

A (local)–multiplayer AI–powered Hex board game

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages