Create cache directory if it does not exist
Remove local cache
Sweep AI is a minesweeper clone enhanced with deep learning capabilities. While minesweeper may not exactly be NP-complete and multiple strategies that make the game easier exist, why not make the neural network solve the problem for us?
Warning: this doesn't work so well.
The safest way to clone the repo and install the game within a virtual environment
# In the project's directory python3 -m venv .venv source .venv/bin/activate pip install . python3 -m sweep-ai # Play the game
For development, use poetry:
# In the project's directory poetry install poetry run pytest # Run unit tests poetry run sweep-ai # Play the game
The players' brains and training data are cached and looked for in the following order:
Run the game with
--clean-cache flag to remove the cache directory. Use
--no-cache if you don't want to use the
cached models (cached training data is still used). To generate a plot of player's loss after training add the
The AI is built using keras. The interface uses pygame and pygame-menu.