Skip to content

44mira/gosweeper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

51 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

image

Play minesweeper straight from your command line!

✴️ Dependencies

  • Go
  • A Nerd Font
  • Not a strict dependency, but only tested on the kitty terminal
    • Might have formatting issues on other terminal emulators

✴️ TODO

  • 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)
  • 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

✴️ Optional features

  • 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)

✴️ Build instructions

  1. Clone this repo
git clone https://github.com/44mira/gosweeper.git

cd gosweeper
  1. Build the binary
go build gosweeper
  1. 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

About

Minesweeper on the command line!

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages