I developed a fully functional chess game in C++ adhering to all Chess rules. The game features two modes: Player vs Player and Player vs AI, with the AI opponent powered by a negamax algorithm with alpha-beta pruning. I also implemented game setup via FEN strings. The AI achieves a skill level comparable to a 700 rating, offering a balanced challenge for casual players.
My AI is White. 700 Elo AI is Black
To develop the AI for my Chess game, I implemented the Negamax algorithm with Alpha-Beta Pruning to efficiently search through possible moves and find the optimal strategy. Negamax simplifies the process of evaluating game states by treating both players symmetrically. Alpha-Beta Pruning further enhances this by cutting off branches of the game tree that won’t affect the outcome, allowing the AI to explore deeper into the game and make quicker decisions. The AI’s decisions are guided by evaluation board logic, which assigns weighted values to different pieces and positions. This enables the AI to understand and prioritize strategic concepts such as controlling the center, defending key pieces, and maintaining a strong pawn structure. As a result, the AI can effectively attack, defend, and consistently find the best possible move in a given situation, providing a challenging and intelligent opponent.
For my Chess Game, I implemented the user interface using Dear IMGUI, a lightweight and immediate-mode graphical user interface library. This allowed me to create intuitive, responsive menus and HUD elements with minimal overhead. I used it to display game information, such as turn indicators and game states, as well as to create controls for resetting the game and navigating the chessboard. Dear IMGUI’s flexibility made it easy to integrate dynamic UI updates based on the game’s progress.