A portable wxWidgets port of the classic Windows Reversi game by Chris Peters. The original Win16 sample has been split into a GUI-free C++ engine and a thin wxWidgets front-end, so it now builds and runs natively on Windows, macOS, and Linux/GTK.
- macOS:
- Windows:
- Linux:
- Faithful reproduction of the original Microsoft Reversi gameplay
- Four skill levels (alpha-beta search depths 1, 2, 4, 6): Beginner, Novice, Expert, Master
- Hint (flashing marker) and Pass commands
- Color / monochrome board modes
- Legal-move cursor feedback (cross on legal squares, arrow otherwise)
- Resizable, flicker-free buffered rendering
- XRC resources (
reversi.xrc+ pattern bitmaps) compiled withwxrcand embedded into the executable viabin2c— no runtime data files required - Platform integration:
- Windows: GUI subsystem, icon + manifest (
reversi.rc,reversi.ico) - macOS:
.appbundle withreversi.icns - Linux:
.desktopentry, AppStream metainfo, hicolor icon set
- Windows: GUI subsystem, icon + manifest (
| File / dir | Purpose |
|---|---|
reversi_engine.{h,cpp} |
Portable engine: board state, move generation, alpha-beta search |
reversi_wx.cpp |
wxWidgets front-end (wxApp, wxFrame, BoardPanel) |
reversi.xrc |
XRC resource file referencing the pattern bitmaps |
REVPAT1.bmp, REVPAT8.bmp |
Monochrome / 8-bit board pattern bitmaps |
bin2c.c |
Host tool that embeds the compiled .xrs archive as a C byte array |
cmake/HostCompile.cmake |
Helper to build bin2c with the host compiler even when cross-compiling |
reversi.rc, reversi.manifest, reversi.ico |
Windows resources |
reversi.icns, reversi.iconset/ |
macOS bundle icon |
sizes/ |
Linux hicolor icon theme (16x16 … 256x256, scalable) |
wxmine.desktop, wxmine.metainfo.xml |
Linux desktop / AppStream files |
- CMake 3.16 or newer
- wxWidgets 3.0+ (3.2+ recommended), built with the
core,base,xml, andxrccomponents, and including thewxrcresource compiler - A C++17 compiler (MSVC, Clang, or GCC)
- Linux (Debian/Ubuntu):
sudo apt install libwxgtk3.2-dev - macOS (Homebrew):
brew install wxwidgets - Windows: build wxWidgets from source and set
wxWidgets_ROOT_DIR(or use the official pre-built binaries)
cmake -S . -B build
cmake --build build --config ReleaseThe build does the following extra steps automatically:
- Compiles the host tool
bin2cwithHostCompile.cmake. - Runs
wxrcto packreversi.xrc+ the two BMPs intoreversi.xrs. - Runs
bin2cto turnreversi.xrsintoreversi_xrs.h, which is compiled into the executable.
- Linux:
./build/wxreversi - macOS:
open build/wxreversi.app - Windows:
build\Release\wxreversi.exe
cmake --install build --prefix /usr/localInstalls the binary to bin/, the .desktop file to
share/applications/, the AppStream metainfo to share/metainfo/, and the
icon set to share/icons/hicolor/.
You (red / white) play against the computer (blue / black). Click any square where the cursor becomes a cross to place a piece; all bracketed enemy pieces are flipped to your colour. The computer replies automatically.
| Menu | Action |
|---|---|
| Game → New | Start a new game |
| Game → Hint | Flash the engine's recommended move (marks the session as a "Practice Game") |
| Game → Pass | Pass when no legal move is available |
| Game → Change Color Mode | Toggle between color and black-and-white boards |
| Skill | Select search depth: Beginner / Novice / Expert / Master |
| Help → About | About dialog |
Keyboard: Ctrl+H hints, Return / Space plays the first legal move in preference order.
The game ends when neither side has a legal move; the final score is displayed along with the margin of victory.
- Board is a 10x10 sentinel-padded
uint8_t[100](squares 11..88 are playable), which lets the flipping loops safely walk off the edge. - Search: alpha-beta with a fixed move-ordering table (corners first, edges next, interior last). Depths 1 / 2 / 4 / 6 match the original skill levels.
- The engine preallocates
MaxDepth + 2board copies so the recursive search performs no heap allocation. reversi_engine.{h,cpp}is entirely GUI-free — it can be reused with any C++ front-end (Qt, SDL, a CLI, etc.).
- Original game: Microsoft / Chris Peters (Windows Reversi sample)
- wxWidgets port: 2026


