doobdood

Minesweeper.h

May 9th, 2016
193
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #ifndef MINESWEEPER_H
  2. #define MINESWEEPER_H
  3.  
  4. #include <iostream>
  5. #include <random> //for rng and seed generation
  6. #include <ctime>
  7. #include <cstdlib> //for system("cls");
  8. #include <conio.h> //for _getch();
  9.  
  10. using namespace std;
  11.  
  12. class Minesweeper
  13. {
  14.     public:
  15.         Minesweeper(); //constructor
  16.         void pointCheck(int y, int x);
  17.         void printBoard();
  18.         void runGame();
  19.         void checkInput(int key);
  20.         void checkClick();
  21.         void checkPendingSpace();
  22.         void checkGameWon();
  23.         int checkPendingAmt();
  24.     protected:
  25.     private:
  26.         int board[17][17][2];
  27.             /*    y   x   z
  28.                   2nd layer of z-dimension represents status of that square:
  29.                     0 means not clicked
  30.                     1 means clicked
  31.                     2 means flagged
  32.                     3 means unknown
  33.                     4 means pending review */
  34.         int positionX = 7; //coordinates of cursor
  35.         int positionY = 7;
  36.         int mines = 35; //number of mines left
  37.         bool gameRunning = true; //for the loop in runGame();
  38.         bool gameWon = false; //says if you're a loser or not
  39. };
  40.  
  41. #endif // MINESWEEPER_H
Advertisement
Add Comment
Please, Sign In to add comment