AI / MiniMax

♟️ MiniMax

Game tree search algorithm for adversarial games. Implemented in Chess Bot and Dots and Boxes with alpha-beta pruning.

MiniMax is a decision-making algorithm for two-player zero-sum games. I implemented it for both a Chess Bot and a Dots and Boxes game. The algorithm recursively explores the game tree, assuming the opponent plays optimally, to find the move that maximises the minimum possible score. To make it practical for chess (exponential branching factor), I implemented alpha-beta pruning — which prunes branches that cannot influence the final decision, dramatically reducing computation. The chess bot evaluates positions using a custom heuristic considering material, piece activity, king safety, and pawn structure.