a minesweeper game written in Cobol.
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-06-04 14:44:42 +02:00
icon.png added screenshot and icon. 2026-06-04 14:44:42 +02:00
LICENSE Initial commit 2026-06-04 12:33:09 +00:00
minesweeper.cob initial commit. 2026-06-04 14:36:45 +02:00
README.md initial commit. 2026-06-04 14:36:45 +02:00
screenshot.png added screenshot and icon. 2026-06-04 14:44:42 +02:00

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
18 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 19. 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.