How muhammadzain-nu/chess-with-ai-bot works
This is a graphical chess game with a computer-opponent option. A player interacts with the FreeGLUT interface, which manages game input and display; moves are checked and applied by the chess rules engine. The computer player searches for moves, and an opening-book capability is also present. The excerpts show the AI and opening-book modules using the board rules, but do not show the UI’s dispatch to either module, so those UI links are marked unverified.
Main entry points: main.cpp Game UI · chessboard.cpp Board and rules · AI.cpp AI search · OpeningBook.cpp Opening book
Components 6
Game interface
- Game UI
main.cpp
Chess rules
- Board and rules
chessboard.cpp - Bit operations
bitops.h
Computer play
- AI search
AI.cpp - Opening book
OpeningBook.cpp
Other components
- Player
Connections 7
- Player → Game UI: plays through
main.cpp - Game UI → Board and rules: checks and updates
main.cpp - Board and rules → Bit operations: uses bit scans
chessboard.cpp - AI search → Board and rules: searches positions
AI.cpp - Opening book → Board and rules: validates moves
OpeningBook.cpp - Game UI → AI search: requests move
- Game UI → Opening book: checks openings