Skip to content
andyvandPublic

About

Microsoft Minesweeper ported to wxWidgets

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Minesweeper (wxWidgets port)

A portable wxWidgets / C++17 port of the classic Windows Minesweeper that lives in the parent directory. Builds on Linux, macOS, and Windows from a single tree of code (plus Android and classic Mac OS, 68k and PowerPC), using XRC for the menu and dialogs and an embedded sprite sheet (PNG) for the board graphics.

Screenshots

  • Windows:

  • macOS:

  • Mac OS 7.5.X (m68k)

  • Mac OS 9.X (ppc)

  • Linux:

  • Android:

Building

You need wxWidgets 3.x development files and CMake 3.14+.

# macOS
brew install wxwidgets cmake

# Debian / Ubuntu
sudo apt install libwxgtk3.2-dev cmake build-essential

Then:

cd wx
mkdir build && cd build
cmake ..
cmake --build .
./wxmine        # or open wxmine.app on macOS

Classic Mac OS (68k and PowerPC)

Built with the Retro68 toolchain (installed in /opt/retro68) and its wxRetro68 port of wxWidgets, plus a host wxrc:

retro68/build.sh            # or: RETRO68=/path/to/retro68 retro68/build.sh out-dir

This builds the 68k and PowerPC applications and merges them into a single fat (universal) application, build-retro68/Minesweeper.dsk (an HFS disk image for Basilisk II, SheepShaver, QEMU or a real Mac) and build-retro68/Minesweeper.bin (MacBinary). The single-architecture builds are in build-retro68/m68k and build-retro68/ppc. It needs System 7 or later with 32-bit QuickDraw. The board is drawn at its original 1:1 size so that even the Expert board fits a 640x480 screen, and on a black-and-white screen the black-and-white sprites are used by default (Game → Color). Help shows the help pages in a window of its own. The classic Mac icons in retro68/icons.r are generated from assets/sizes by retro68/make-icons.py.

To test unattended in Basilisk II, build with tracing and run it from a copy of a System 7/8 boot disk (BOOT_DISK, default ~/MacROM/HD.img; the original is not modified):

WXMINE_CMAKE_ARGS=-DWXMINE_TRACE=ON retro68/build.sh build-trace
retro68/run-basilisk.sh build-trace/Minesweeper.bin

Basilisk II runs without sound unless NOSOUND=false is set.

The trace build logs its startup to wxtest.log and shuts the Mac down 25 seconds after its window appears; the script prints the log and keeps screenshots in its work directory.

How to play

  • Left-click an unrevealed cell to reveal it. If it's a mine, you lose. Otherwise the cell shows the number of mines in the eight neighbouring cells (or expands a region of empty cells if the count is 0).
  • Right-click an unrevealed cell to flag it as a suspected mine. Click again to switch to a "?" question-mark (if Marks is enabled) or to clear.
  • Middle-click (or left+right together) on a revealed numbered cell to "chord" — reveal all unflagged neighbours at once. Only safe if the number of flags around the cell matches the number on it.
  • Click the smiley to start a new game.

The first cell you reveal is always safe — if you happen to click on a mine, it's relocated to the first available empty cell.

Difficulty levels

Level Width × Height Mines
Beginner 9 × 9 10
Intermediate 16 × 16 40
Expert 30 × 16 99
Custom 9–30 × 9–24 10–999 (capped at (W-1)×(H-1))

Keyboard

  • F2 — start a new game.

Menu options

  • Game → Marks (?) — toggles the third right-click state ("?") on/off.
  • Game → Color — toggles between the colour and black-and-white sprite sheets (preserved for nostalgia).
  • Game → Sound — toggles the tick / win / lose sound effects.
  • Game → Best Times… — shows the persistent high-score table.

Persistence

Settings and best times are stored via wxConfig, which writes to the platform-native location:

  • Windows: HKCU\Software\wxmine\wxmine
  • Linux: ~/.wxmine
  • macOS: ~/Library/Preferences/wxmine Preferences

Credits

Original Minesweeper by Robert Donner and Curt Johnson. This port reuses the original sprite art and game algorithm.

About

Microsoft Minesweeper ported to wxWidgets

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages