A terminal-based Minesweeper game written in PHP.
-
Classic Minesweeper gameplay
-
Runs entirely in the terminal
-
Written in pure PHP
Tested on Windows (PowerShell).
Linux/macOS may work but has not been tested.
- PHP 8.1 or newer
Check your version:
php -v
Clone the repository:
git clone https://github.com/AlexLeLay/php-minesweeper.git
cd php-minesweeper
Run the game:
php ./main.php
The game automatically checks terminal size before starting:
Example:
-
3 4→ reveal row 3, column 4 -
f 3 4→ place/remove a flag
-
Help the user resizing the terminal
-
Add timer
-
Scoring system
-
Custom levels
-
Save the game to resume later
MIT

