Back to work

Minesweeper AI Solver

Interactive Minesweeper with dual AI solvers using logical deduction and probability analysis

Minesweeper Heatmap SolverMinesweeper Algorithm Solver

Timeline

2024

Category

AI & Game Development

Platform

Desktop

Overview

An interactive Minesweeper game built with C++ and SFML that supports multiple solving strategies alongside manual play. The project includes a 9x9 grid-based implementation with a graphical interface, featuring two distinct AI solvers for automated gameplay.

Key Features

  • Algorithm-Based Solver: Uses logical deduction to determine safe moves and flag mines with certainty
  • Heatmap-Based Solver: Employs probability analysis to make decisions when logical deduction isn't possible
  • Interactive Gameplay: Toggle between manual play mode and either automated solver using keyboard controls
  • Performance Tracking: Statistics tracking wins and losses for each solver
  • Clean Architecture: Interface-based design pattern (IBoardSolver) enables easy comparison and extensibility

Technical Implementation

The architecture uses an interface-based design pattern to enable clean separation between the game logic (Board class), rendering system (BoardRenderer), and solver implementations. This allows for easy comparison of solver performance and extensibility for additional solving strategies.

AI Strategies

The algorithm-based solver employs deterministic logic to identify safe cells and mines, while the heatmap solver visualizes probabilities across the board, making informed guesses when certainty isn't achievable. This dual approach demonstrates different paradigms in game-playing AI.

C++SFMLAI AlgorithmsProbability AnalysisGame Development