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
| Mode | Grid | Mines |
|---|---|---|
| Beginner | 9 × 9 | 10 |
| Intermediate | 16 × 16 | 40 |
| Expert | 30 × 16 | 99 |
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:
| Input | Action |
|---|---|
| Left click | Uncover a cell |
| Right click | Flag, question mark, or clear |
| Middle click, or left + right | Chord |
| Click the face | New game |
| Arrow keys, WASD | Move the cursor |
| Space / Enter | Uncover the cell under the cursor |
| F | Flag the cell under the cursor |
| Escape | Back to the menu. The game can be resumed |
| Alt+Enter | Toggle fullscreen |
Touch, on phones, tablets, and mobile browsers:
| Gesture | Action |
|---|---|
| Tap a covered cell | Uncover it |
| Press and hold a cell | Flag, question mark, or clear |
| Tap a number | Chord |
| Tap the face | New game |
| Tap the title bar, or two-finger tap | Back to the menu. The game can be resumed |
| Tap a menu row | Choose 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.
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.