opensweeper is Minesweeper. Uncover every safe cell on the grid, using the numbers that count the mines next to each one.

opensweeper is free, open source, and has no tracking.

How to play

Rules

  • The grid hides a fixed number of mines. Uncover every cell that is not a mine to win. Uncovering a mine loses the game.
  • A number on an uncovered cell is the count of mines in the eight cells around it.
  • The first cell uncovered is never a mine.
  • Flag a cell to mark it as a mine. The counter on the left shows mines minus flags placed, and goes below zero if there are more flags than mines.
  • With Marks (?) turned on in Options, flagging a cell a second time marks it with a question mark.
  • Chording a number whose mines are all flagged uncovers the rest of its neighbours.
  • The clock on the right counts seconds from the first cell uncovered.
  • The face button starts a new game.

Difficulty

ModeGridMines
Beginner9 × 910
Intermediate16 × 1640
Expert30 × 1699

Difficulty and Marks are set under Options in the menu. A change of difficulty applies from the next game.

Controls

Mouse and keyboard, on computers and in desktop browsers:

InputAction
Left clickUncover a cell
Right clickFlag, question mark, or clear
Middle click, or left + rightChord
Click the faceNew game
Arrow keys, WASDMove the cursor
Space / EnterUncover the cell under the cursor
FFlag the cell under the cursor
EscapeBack to the menu. The game can be resumed
Alt+EnterToggle fullscreen

Touch, on phones, tablets, and mobile browsers:

GestureAction
Tap a covered cellUncover it
Press and hold a cellFlag, question mark, or clear
Tap a numberChord
Tap the faceNew game
Tap the title bar, or two-finger tapBack to the menu. The game can be resumed
Tap a menu rowChoose it. In Options, a tap cycles the value

Where to play

  • Browser: play it here. Nothing to install.
  • iPhone and iPad: on the App Store. iOS 15 or later.
  • Android: install the APK from the latest release. It is not on Google Play.
  • Windows, macOS, Linux: download the archive for your system from the latest release.
Download opensweeper on the App Store

Technical details

Source code: github.com/dannyheskett/opensweeper, MIT license.

Code

  • Written in C.
  • The game logic (src/game.c) and the board layout (src/layout.c) are platform-independent. Every platform uses them unchanged. Unit tests cover both and need no window.
  • Drawing, input, and audio use raylib 6.0 on Windows, macOS, Linux, Android, and the web. iOS uses its own Metal and UIKit backend with no raylib.
  • Sound effects are synthesized at startup. The Nunito typeface is embedded in the binary. There are no asset files.
  • The browser version is the same C compiled to WebAssembly with Emscripten.

Layout

One layout serves every screen. Each frame the grid is sized to the window at the largest square cell that fits. On a desktop it grows with the window. On a phone or tablet it works in both orientations and re-fits on rotation. When a grid fits better turned sideways it is drawn turned, so Expert’s 30 × 16 grid is shown as 16 columns of 30 on a phone held upright.

Recording

Desktop builds record the session to an H.264 MP4 file, one video frame per rendered frame, with no external tools. Turn on Record in the menu, or start with --record or --record <file>.mp4. Mobile and web builds do not include the recorder.

Builds and releases

Every push to main builds and publishes a release: Linux x86-64, macOS universal, Windows x64 and x86, an Android APK, an iOS .ipa, and the WebAssembly bundle. The .ipa is the App Store build and cannot be sideloaded. Build instructions are in the README.