This is a classical game called "Mine Sweeper" (or "扫雷" in Chinese) implemented with C and SDL 2.
How to build
- CMake 3.5+
- C compiler and toolchain
Because SDL is designed to be cross-platform, any modern OS with suitable build tools should be able to build and run this project.
- Download Development Libraries from SDL 2 download page or install them from the package manager of your OS.
- Download other Development Libraries for the following SDL plugins or install them from the package manager of your OS.
- If you download these files manually, you should modify
CMakeLists.txtto correct the paths of library files. If you are using a package manager, probably you don't need to change this, because the libraries will be installed globally.
- Use CMake to generate a build system
mkdir build cd build cmake -G "MinGW Makefiles" ..
Here I use the "MinGW Makefiles" generator in CMake because I have mingw32 installed on my Windows 10, but you may use other generators (or the default one for your OS) if you have setup corresponding libraries correctly.
- Build it
You may use CMake to build it
cmake --build .
or directly use the corresponding build tools for the generated build system, e.g. (for mingw32)
How to run
Run it through double-click or command line.
If you run it through command line, you may specify customized initialization parameters for this game:
|3||number of mines||40|
MineSweeper.exe 16 16 40
The classical parameter settings are:
|Difficulty||map width||map height||number of mines|
The default parameters are adopted from the "Easy" difficulty and will be used when no customized parameters are given (e.g. when you double-click it).
- Windows 10 (32 bit) + MinGW 32
- Windows 10 (64 bit) + MinGW 32
- Windows 10 (32 bit) + Visual Studio 2015
- Windows 10 (64 bit) + Visual Studio 2015
- Ubuntu 14.04 (32 bit)
- Ubuntu 14.04 (64 bit)
- Mac OS X 10.11
- Android 4.2
- iOS 9.3
Only ticked platforms are tested, but technically all platforms listed above should be able to support this game.