A GUI implementation of the classic Minesweeper game written in Go. Using Cogent Core
This project is a Go-based implementation of the classic Minesweeper game where players need to clear a board containing hidden mines without detonating them, using clues about the number of neighboring mines in each field.
- Classic Minesweeper gameplay.
- Graphical user interface powered by Cogent Core.
- Left-click to reveal cells.
- Right-click or long press to toggle flags on suspected mine locations.
- Visual indication of revealed numbers, mines (on game loss), and flags.
- Win and Loss detection with notification messages (Snackbar).
- "Reset" button to start a new game with the same dimensions and mine count.
- Safe First Click: The first cell you interact with (left or right-click) is guaranteed not to be a mine. Mines are placed after your first interaction, avoiding that specific cell.
- Uses embedded SVG icons for flags and mines.
- Board dimensions and mine count are currently set in
main.go
(e.g., 10x10 with 10 mines).
- Go 1.24 or higher
- Git (for version control)
- Clone the repository:
git clone [repository-url]
cd minesweepercogent
go build
./minesweepercogent
Install core cli
https://www.cogentcore.org/core/install
Specifically to deal with a zoom issue on webgpu
go install cogentcore.org/core/cmd/core@5d9ff27
core build web
Note, your web server should support correct mime type for wasm i.e. 'application/wasm', or it won't load