-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMinesweeper.h
More file actions
80 lines (60 loc) · 1.6 KB
/
Minesweeper.h
File metadata and controls
80 lines (60 loc) · 1.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#pragma once
#include <iostream>
using std::cout;
using std::endl;
using std::cin;
#include <string>
using std::string;
#include <ctime>
using std::time;
class Board {
public:
Board();
~Board();
Board(int rows, int cols, int mines);
char printTile(int tile);
void topRowVisualBoard();
void mainVisualBoard();
void exposedVisualBoard();
void printBoard();
void printBoardExposed();
int index(int x, int y);
int nearbyMines(int x, int y);
int checkUpperRow(int x, int y);
int checkCurrentRow(int x, int y);
int checkLowerRow(int x, int y);
void initiateBoard();
void initiateMines();
bool checkExposed(int tile);
bool revealedTileError(int tile);
bool revealTile(int tile);
bool invalidTile(int x, int y);
bool exposedError(int tile);
bool flagError(int tile);
int boardCols;
int boardRows;
int totalTiles;
int mineCount;
int* visualBoard;
int* valueBoard;
private:
};
class Minesweeper {
public:
Minesweeper();
~Minesweeper();
int difficultyChoice(string ss);
void beginningSettings();
void chooseTile(int & idx, char & mode);
void changeTile(int idx, char mode);
int endGameCheck(int idx);
bool mainGame();
void mineSweeperSolver(char & mode);
private:
Board* mainBoard;
int rows;
int cols;
int mines;
bool gameState;
bool proceed;
};