Skip to content

fancellu/minesweepercogent

Repository files navigation

Minesweeper Game

A GUI implementation of the classic Minesweeper game written in Go. Using Cogent Core

Description

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.

Features

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

Screenshot

screenshot.png

Prerequisites

  • Go 1.24 or higher
  • Git (for version control)

Installation

  1. Clone the repository:
git clone [repository-url]
cd minesweepercogent

go build

To run locally

./minesweepercogent

To run on web via wasm

Click here to Preview

To build for web

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

About

A GUI implementation of the classic Minesweeper game written in Go. Using Cogent Core

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages