# Terminal Minesweeper

A Minesweeper game that runs in your terminal using the gocui library.

![Minesweeper Screenshot](screenshot.png)
## Features

- Classic Minesweeper gameplay
- Colorful terminal interface with emoji characters
- Mouse support for opening cells and placing flags
- First-click safety (you'll never hit a mine on your first click)

## How to Install and Run

### Prerequisites

- Go 1.22 or later (for math/rand/v2)
- Git

### Installation

1. Clone the repository:
   ```
   git clone https://gitea.boner.be/bdnugget/minesweeper
   cd terminal-minesweeper
   ```

2. Install dependencies:
   ```
   go mod tidy
   ```

### Running the Game

Simply run:
```
go run main.go
```

You can customize the game with command line flags:
```
go run main.go -rows=15 -cols=20 -mines=30
```

Available options:
- `-rows`: Number of rows (default: 10, minimum: 5)
- `-cols`: Number of columns (default: 10, minimum: 5)
- `-mines`: Number of mines (default: 10, maximum: 1/3 of total cells)

## How to Play

- Left-click: Open a cell
- Right-click: Place/remove a flag
- 'R' key: Restart the game (broken for now lol)
- Ctrl+C: Quit the game

## License

This project is licensed under the BSD 3-Clause License - see the [LICENSE](LICENSE) file for details. 