Play minesweeper straight from your command line!
- Go
- A Nerd Font
- Not a strict dependency, but only tested on the
kittyterminal- Might have formatting issues on other terminal emulators
- Generate field
- Handle invalid field parameters
- Distribute mines pseudo-randomly
- Display field
- Use Nerdfont Icons
- Color tiles
- Use a CLI Framework (TCell)
- Number tiles based on neighbor mines
- Flagging
- Command line arguments
- Board dimensions
- Mines
- Controls
- Mouse controls
- Dig (left click)
- Expanding dig
- Flag (right click)
- Dig (left click)
- Mouse controls
- Game ends
- Win
- Loss
- Self-solve
- Create a separate game loop for self-solving runs
- Add a flag for self-solve
- Create the algorithm
- Calculate probabilities for every possible closed tile
- Queue all tiles with lowest probability
- Dig every tile in the queue
- Re-calculate the probabilities
- Create the self-solve animation
- 0.5s per dig
- Add a flag argument for the solve speed
- Restart on game end
- Better generation algo (deterministic minesweeper)
- Centering
- Create a flag for centering the board
- Roughly center the board on screen
- Recenter on resize
- Theme
- Colors config file
- Timer
- Stopwatch
- Time trial
- Keyboard
- Arrow keys
- HJKL
- Flag (space)
- Dig (enter)
- Clone this repo
git clone https://github.com/44mira/gosweeper.git
cd gosweeper- Build the binary
go build gosweeper- Run the game and pass command flags
# macos / linux
./gosweeper -mine=10 -x=5 -y=5 # start a game 5x5 game with 10 mines
# windows
gosweeper.exe| Flag | Usage |
|---|---|
| mine | Number of mines |
| x | Width of the field |
| y | Height of the field |
| s | Self-solve speed |
