How imadtg/domino-ai works
• A representation of the domino pieces, game state, and players’ hands.
• A game loop and logic that control the flow of the game.
• An artificial intelligence engine using minimax (and possibly heuristic techniques aided by a heap structure) to decide on moves.
Main Components
• Game Controller/Entry Point: Represented by main.c, this is where the program starts and orchestrates the game.
• Game Logic:
• game.c/game.h: Handles overall game rules, state transitions, and game progress.
• domino.c/domino.h, block.c/block.h, and snake.c/snake.h: Likely manage the creation and representation of domino pieces and the playing field (the “snake” of dominoes) as well as possibly grouping “blocks” or pieces.
• hands.c/hands.h: Manages the players’ hands or sets of dominoes.
• move.c/move.h: Responsible for representing and processing player moves.
• cst.h: Likely contains central constants used across the game.
• AI Engine:
• minimax.c/minimax.h: Implements the minimax algorithm, the core of the AI decision making.
• Utility Structures:
• heap.c/heap.h: Possibly used as a support data structure for the AI, such as managing move ordering or heuristics within the minimax algorithm.
• Build & Automation:
• Makefile: Supports building the project.
• .github/workflows: Provides CI/CD setups.
Relationships and Interactions
• How “Game Logic” relies on board / piece representation modules (domino, block, snake) and “Hands” management.
• “AI Engine” to utility support like the “Heap” module, if it’s used to optimize move ordering or evaluation processes.
Architectural Patterns
• The design is modularized into distinct components for game state management, AI decision making, and utility functions.
• This separation is similar to a layered or modular design where the “Core Game Engine” is clearly isolated from the “AI/Decision Module.”
• Role of minimax as an algorithmic pattern in game tree search and decision-making.
Incorporate Relevant Technologies and Frameworks
• The project is written in C using procedural programming.
• The CI/CD is managed via GitHub workflows (see folder .github/workflows), so you might indicate integration points for automated builds/tests.
• The Makefile is used for build automation.