This project explores game theory and adversarial search by creating an optimal AI agent for the mathematical strategy Game of Nim. The program uses the Minimax algorithm to build an unbeatable opponent that evaluates all possible future moves to find a guaranteed path to victory.
Language: Python
Skills: Minimax Algorithm, Game Theory, Adversarial Search, Recursion.
Minimax Algorithm: Implemented the Minimax algorithm to determine the optimal move in a two-player, zero-sum game.
Adversarial Search: The AI searches the game tree to maximize its own score while assuming its opponent is actively trying to minimize it, allowing it to play perfectly.
Game Modes: Supports both Human vs. AI and AI vs. AI game modes for testing and demonstration.
Dynamic Move Generation: Includes a function that generates all possible legal moves from any given game state for the AI to evaluate.