Minesweeper game in C with a GUI. The main.c file is the Minesweeper game played in the terminal and the main_Graphic.c includes a GUI using GTK. This is the first assignment of the MECHTRON 2MP3 course at McMaster University. To play with the GUI, compile main_Graphic.c. To play without the GUI, compile main.c
gcc -o main_Graphic main_Graphic.c $(pkg-config --cflags --libs gtk+-3.0)
./main_Graphic
gcc -o main main.c
./main
Check out the video demonstration to see the Minesweeper app in action!
In order to run the version of the game with the GUI (main_Graphic.c), you must have GTK 3 installed. The shell game (main.c) requires no previous installations other than the C compiler. The installation steps are listed below for Windows and Mac.
If you are running on a macOS, run the following commands in the terminal if you do not already have GTK 3 installed on your system:
- Install Homebrew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" - Install GTK and pkg-config via Homebrew
brew install gtk+3 pkg-config - Compile the Program
gcc -o main_Graphic main_Graphic.c $(pkg-config --cflags --libs gtk+-3.0)
./main_Graphic
If you are running on a Windows operating system, run the following commands in the PowerShell if you do not already have GTK 3 installed on your system:
- Install Development Tools
sudo apt updatesudo apt install libgtk-3-dev build-essential - Compile the Program
gcc -o main_Graphic main_Graphic.c $(pkg-config --cflags --libs gtk+-3.0)
./main_Graphic