repository

MineSweeper§

Logic based AI Algorithms to solve MineSweeper

Usage§

Arguments§

FlagTypeDescription
--dimintDimension of the minesweeper board
--agentnone, basic, advanced, hyper_advanced, bonus_1, bonus_2Which agent to use
--bomb_countintNumber of bombs to place randomly across the board
--use_steppingboolWhether or not to use wait for input between agent solving steps. Great for debuging
--quit_when_finishedboolWhether you want pygames window to close when advanced agents are finished

Example§

Refer to DEVELOPMENT for how to setup virtualenv

$ source minesweepervenv/bin/activate
$ python3 main.py --agent basic --dim 25 --bomb_count 20

Commands§

Game Commands§

KeyFunction
RETURNOpen tile the agent is currently t
fPlace flag on tile the agent is currently at

Debugging Commands§

KeyFunction
sHold down to highlight bombs
rRe-initialize board tiles
nIf --use_stepping flag is set, steps the agent forward one step

Development§

1. Clone Repository (Do this once)§

$ git clone https://github.com/reaganmcf/MineSweeper
$ cd MineSweeper

2. Setup Virtual Environment (Do this once)§

  • If you don't have venv installed, run the following
    python3 -m pip install --user virtualenv
    
$ python3 -m venv minesweepervenv

3. Activate Virtual Environemnt (Do this everytime)§

source minesweepervenv/bin/activate

4. Install packages (Do this when you're missing new libraries added to requirements.txt)§

(minesweepervenv) $ pip install -r requirements.txt

5. Update requirements.txt (Do this whenever you add a new library to the project so the change is reflected on github)§

(minesweepervenv) $ pip freeze > requirements.txt