A pattern-driven console game engine featuring an unbeatable AI player powered by the Minimax algorithm.
The system is built with a focus on clean separation of concerns and architectural scalability. By utilizing the Strategy Pattern, the game engine fully decouples the execution of game loops from the underlying player types (Human vs. various AI implementations). This allows for seamless extensibility when introducing new behaviors or automation layers.
The core highlight of the project is the Hard AI player, which implements the Minimax Algorithm. The algorithm recursively evaluates the entire state tree of the game matrix to guarantee mathematically optimal moves, making the highest difficulty layer completely unbeatable.
Strategy Pattern & AI Difficulty Levels [Logic]
The application supports multiple gameplay modes (Human vs. Human, Human vs. AI, and AI vs. AI) driven by a dynamic player injection mechanism.
- EASY: Executes completely random legal moves across the board grid.
- MEDIUM: Evaluates immediate state changes; prioritizes blocking an opponent's winning vector or executing its own winning move in a single step.
- HARD: Leverages the Minimax Algorithm to simulate all possible outcomes, ensuring a perfect game strategy.
.\mvnw.cmd clean package./mvnw clean packageThe system compiles into an executable shaded JAR containing all structural classes.
java -jar target/Tic_Tac_Toe_with_AI-1.0.jarThe project is 100% compliant with Google's coding standards. Every class and method is fully documented using Javadoc.
The codebase undergoes strict static code analysis to eliminate redundancies, unused variables, and logical anti-patterns.
Bytecode analysis confirms the absence of hidden bugs, multi-threading vulnerabilities, or null pointer execution risks.


