Minesweeper

December 4, 2025 · View on GitHub

A classic Minesweeper game for the terminal, built with Dart and nocterm.

███╗   ███╗██╗███╗   ██╗███████╗███████╗
████╗ ████║██║████╗  ██║██╔════╝██╔════╝
██╔████╔██║██║██╔██╗ ██║█████╗  ███████╗
██║╚██╔╝██║██║██║╚██╗██║██╔══╝  ╚════██║
██║ ╚═╝ ██║██║██║ ╚████║███████╗███████║
╚═╝     ╚═╝╚═╝╚═╝  ╚═══╝╚══════╝╚══════╝
Minesweeper Minesweeper Minesweeper Minesweeper ## Features
  • Terminal-based UI with keyboard controls

  • Three difficulty levels:

    DifficultyGrid SizeMine Density
    Easy9×912%
    Medium16×1624%
    Hard24×2436%
  • Animated game over sequence

  • Flag system to mark suspected mines

Requirements

  • Dart SDK >=3.9.0 <4.0.0

Installation

dart pub get

Usage

dart run

Controls

KeyAction
Arrow KeysMove cursor
SpaceReveal cell
FFlag/unflag cell
EnterConfirm selection

How to Play

  1. Select a difficulty level on the intro screen
  2. Navigate the grid using arrow keys
  3. Press Space to reveal a cell
  4. Press F to flag cells you suspect contain mines
  5. Reveal all non-mine cells to win
  6. Hit a mine and it's game over!

Project Structure

lib/
├── main.dart           # Entry point
└── src/
    ├── app.dart        # Root application component
    ├── models/         # Data models (Difficulty, Place, etc.)
    ├── provider/       # State management
    └── screens/
        ├── intro/      # Difficulty selection screen
        ├── mine_sweeper/  # Main game screen
        └── game_over/  # Game over screen

Dependencies