Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 

Repository files navigation

Minesweeper

Overview

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

Terminal Command to Run main_Graphic.c

gcc -o main_Graphic main_Graphic.c $(pkg-config --cflags --libs gtk+-3.0)
./main_Graphic

Terminal Command to Run main.c

gcc -o main main.c
./main

Video Demo

Check out the video demonstration to see the Minesweeper app in action!

GTK 3 Install

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.

Mac Install

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:

  1. Install Homebrew
    /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
  2. Install GTK and pkg-config via Homebrew
    brew install gtk+3 pkg-config
  3. Compile the Program
    gcc -o main_Graphic main_Graphic.c $(pkg-config --cflags --libs gtk+-3.0)
    ./main_Graphic

Windows Install

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:

  1. Install Development Tools
    sudo apt update
    sudo apt install libgtk-3-dev build-essential
  2. Compile the Program
    gcc -o main_Graphic main_Graphic.c $(pkg-config --cflags --libs gtk+-3.0)
    ./main_Graphic

About

Minesweeper game in C with a GUI using GTK.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages