Project
Knowledge-Based Minesweeper AI
A Python AI agent that plays Minesweeper by representing game knowledge as logical sentences and using inference to identify safe moves and mines.
Overview
This project implements a Minesweeper-playing AI agent using knowledge representation and logical inference. It originated from CS50AI coursework and is presented here as a focused reasoning-system implementation in Python.
The agent observes revealed cells, records what each clue implies about nearby hidden cells, and uses that knowledge to decide which cells are safe, which cells are mines, and when it needs to make a fallback move.
Problem
Minesweeper requires reasoning from partial information. Each revealed cell gives a count of nearby mines, and the agent must use that evidence to infer which neighboring cells are safe or dangerous.
Approach
The AI stores knowledge as logical sentences about groups of cells and mine counts. It updates the knowledge base after each move, marks known mines and safe cells, derives new sentences from existing knowledge, and chooses safe moves when possible.
Outcome
The project demonstrates how a knowledge-based agent can make decisions under uncertainty by combining explicit facts, inference rules, and fallback move selection.
Tradeoffs
This project strengthened my understanding of representing uncertainty, maintaining a knowledge base, deriving new facts, and translating logical reasoning into clear Python code.