sweeper

module
v0.0.0-...-bd35d1c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 17, 2024 License: MIT

README

Sweeper

Play Minesweeper inside your terminal.

screenshot

Getting Started

Dependencies

Make sure to have go downloaded and installed (download here)

Installing

First clone the repo

git clone https://github.com/jnarcher/sweeper

Then enter the directory and build the executable

cd sweeper && make

The executable can be found in the target directory.

Usage

The following flags can be set to configure the board:

  • w : width (columns)
  • h : height (rows)
  • b : number of bombs

If no value for the number of bombs is provided, the program will default to 1/6th of the total squares available.

Example:

./sweeper -w 20 -h 20 -b 50

This will create a minesweeper game in a grid of 20 columns by 20 rows with 50 bombs.

Controls

To move the cursor around the grid you can use the following options for up, left, down, and right respectively:

  • w, a, s, d
  • h, j, k, l
  • arrow keys

To mark a bomb with a flag use the enter key.

To reveal a square, use the space bar. Pressing the reveal key on an already revealed square will reveal all surrounding unflagged squares (use with caution).

Press q or ctrl+q to quit at any time.

Attributions

Sweeper was built using the Bubble Tea TUI framework, which provided the tools to create an intuitive and responsive terminal interface. Special thanks to the Charm team for their excellent framework.

Directories

Path Synopsis
cmd
sweeper command
internal

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL