a minesweeper game written in Cobol.
- COBOL 100%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| icon.png | ||
| LICENSE | ||
| minesweeper.cob | ||
| README.md | ||
| screenshot.png | ||
Minesweeper in COBOL
A terminal Minesweeper game written in GnuCOBOL. 9×9 grid, 10 mines.
Compiling
Install GnuCOBOL if you don't have it:
# Fedora/RHEL
sudo dnf install gnucobol
# Debian/Ubuntu
sudo apt install gnucobol
Compile:
cobc -x -o minesweeper minesweeper.cob
Run:
./minesweeper
How to Play
The board starts fully hidden. Each cell is one of:
| Symbol | Meaning |
|---|---|
# |
Hidden cell |
. |
Revealed — no adjacent mines |
1–8 |
Revealed — number of adjacent mines |
F |
Flagged by you |
* |
Mine (shown at game over) |
Commands
r <row> <col> Reveal a cell
f <row> <col> Flag or unflag a cell
q Quit
Row and column are numbers 1–9. Examples:
r 5 5 reveal the center cell
f 1 9 flag the top-right cell
Rules
- First move is always safe — mines are placed after your first reveal.
- Revealing an empty cell (
.) automatically reveals all connected empty cells and their numbered borders. - Flagging is just a visual reminder — it does not count toward winning.
- You win by revealing every cell that isn't a mine.
- You lose by revealing a mine.