Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #ifndef MINESWEEPER_H
- #define MINESWEEPER_H
- #include <iostream>
- #include <random> //for rng and seed generation
- #include <ctime>
- #include <cstdlib> //for system("cls");
- #include <conio.h> //for _getch();
- using namespace std;
- class Minesweeper
- {
- public:
- Minesweeper(); //constructor
- void pointCheck(int y, int x);
- void printBoard();
- void runGame();
- void checkInput(int key);
- void checkClick();
- void checkPendingSpace();
- void checkGameWon();
- int checkPendingAmt();
- protected:
- private:
- int board[17][17][2];
- /* y x z
- 2nd layer of z-dimension represents status of that square:
- 0 means not clicked
- 1 means clicked
- 2 means flagged
- 3 means unknown
- 4 means pending review */
- int positionX = 7; //coordinates of cursor
- int positionY = 7;
- int mines = 35; //number of mines left
- bool gameRunning = true; //for the loop in runGame();
- bool gameWon = false; //says if you're a loser or not
- };
- #endif // MINESWEEPER_H
Advertisement
Add Comment
Please, Sign In to add comment