Skip to content

SecCodeSmith/SapperCpp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SapperCpp

SapperCpp is a C++ implementation of the classic Minesweeper game, developed as a course project to fulfill the requirements of a C++ programming course. The game utilizes the Simple and Fast Multimedia Library (SFML) to provide graphical rendering and user interaction.

Features

  • Graphical User Interface: Renders the game board and handles user interactions using SFML.
  • Customizable Board: Allows for different board sizes and difficulty levels by adjusting the number of mines.
  • Interactive Gameplay: Supports standard Minesweeper functionalities, including revealing cells, flagging mines, and checking for win/loss conditions.

Prerequisites

  • C++ Compiler: Ensure you have a C++17 compatible compiler installed.
  • SFML Library: Install the SFML library for graphical rendering and event handling.

Installation

  1. Clone the Repository:

    git clone https://github.com/SecCodeSmith/SapperCpp.git
    cd SapperCpp
  2. Install SFML:

    • On Ubuntu:
      sudo apt-get install libsfml-dev
    • On Windows:
      • Download the SFML library from the official website.
      • Follow the provided instructions to set up SFML with your compiler.
  3. Build the Project:

    mkdir build
    cd build
    cmake ..
    make

Usage

  • Run the Game:
    ./SapperCpp
  • Gameplay Instructions:
    • Left-click to reveal a cell.
    • Right-click to flag or unflag a cell as a mine.
    • The game ends when all non-mine cells are revealed or a mine is clicked.

Project Structure

  • main.cpp: Contains the main function to initialize and run the game.
  • Board.cpp / Board.h: Defines the game board and related functionalities.
  • Field.cpp / Field.h: Manages individual cells on the game board.
  • WindowGen.cpp / WindowGen.h: Handles the creation and management of the game window using SFML.
  • Play.cpp / Play.h: Implements the game logic and user interaction.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published