A clone of the classic Minesweeper game.
This is one of the first programs I wrote. The code is written in C and uses SDL2 for handling the graphics and the mouse input. The game has been tested to run on both Windows and Linux.
A compiled release is available here: https://github.com/AlfonsoJLuna/minesweeper/releases
- Clone this repository:
git clone https://github.com/AlfonsoJLuna/minesweeper
- Install SDL2 development libraries. For example, on Ubuntu:
sudo apt-get install libsdl2-dev
- Go to the repository folder:
cd minesweeper
- Compile the program:
gcc source/minesweeper.c -Wall -std=c99 `sdl2-config --cflags --libs` -o minesweeper
- Run the program:
./minesweeper
- Clone or download this repository.
- Download and install the mingw-w64 toolchain. Prebuilt binaries are available here. Be sure you check
Add to PATH
during installation. - Download the SDL2 development libraries for MinGW and extract them to
minesweeper/libraries/SDL2-2.0.12/...
- Open a command prompt and go to the repository folder.
- Compile the program:
gcc source/minesweeper.c -Ilibraries/SDL2-2.0.12/x86_64-w64-mingw32/include/SDL2 -Llibraries/SDL2-2.0.12/x86_64-w64-mingw32/lib -Wall -std=c99 -m64 -Wl,-subsystem,windows -lmingw32 -lSDL2main -lSDL2 -o minesweeper.exe
- Copy the
SDL2.dll
file fromminesweeper/libraries/SDL2-2.0.12/x86_64-w64-mingw32/bin/
tominesweeper/
. - Run the program:
minesweeper.exe