Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bashmocha/minesweeper-ai
A simple minesweeper game with AI coded in python. You could play the game either by yourself or with AI.
https://github.com/bashmocha/minesweeper-ai
ai cs50 cs50ai python
Last synced: 24 days ago
JSON representation
A simple minesweeper game with AI coded in python. You could play the game either by yourself or with AI.
- Host: GitHub
- URL: https://github.com/bashmocha/minesweeper-ai
- Owner: BashMocha
- Created: 2022-09-26T18:05:51.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-10-06T20:08:55.000Z (over 2 years ago)
- Last Synced: 2024-12-06T09:38:41.039Z (about 1 month ago)
- Topics: ai, cs50, cs50ai, python
- Language: Python
- Homepage:
- Size: 152 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# minesweeper
A Minesweeper game that you can play by yourself or let AI play for you.**Note:** AI will not always win. There will be some cases where the AI must guess, because it lacks sufficient information to make a safe move. On terminal, there will print whether the AI is making a move it believes to be safe or whether it is making a random move.
## Installation
Run `pip3 install -r requirements.txt` to install pygame.
## Getting Started
`cd` to the directory and run `python3 runner.py` to start playing.
## Project description
It is one of the projects for Harvard's online course **CS50’s Introduction to Artificial Intelligence with Python**. There are two main files in this project: `runner.py` and `minesweeper.py`. `runner.py` was implemented by the teaching staff, and contains all of the code to run the graphical interface for the game. In `minesweeper.py`, the `Minesweeper` class was entirely implemented by the teaching staff.
I implemented `hash`, `known_mines`, `known_safes`, `mark_mine`, and `mark_safe` functions in the `Sentence` class, and `add_knowledge`, `neighbors`, `make_safe_move`, and `make_random_move` functions in the `MinesweeperAI` class.