-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSource.cpp
More file actions
58 lines (54 loc) · 1.24 KB
/
Source.cpp
File metadata and controls
58 lines (54 loc) · 1.24 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
#include <iostream>
#include "Color.h"
#include "MineSweeperGirdHeader.h"
#define LOG(x) std::cout << x << std::endl
int main()
{
//#if 0
// char MyString[] = "Welcome";
// unsigned int Length = 7;
// LOG(MyString);
// DeleteCharFromArray(MyString, Length, 'e');
// LOG(MyString);
// DeleteCharFromArray(MyString, Length, 'e');
// LOG(MyString);
//#else
// MineGrid::PrintRules();
// unsigned int Rows, Cols;
// std::cin >> Cols;
// std::cin >> Rows;
//
// MineGrid DisplayGrid(Cols, Rows);
// DisplayGrid.MakeTitle();
// DisplayGrid.DisplayGrid();
// DisplayGrid.GenerateBombs();
// LOG("Actual Value after bomb seed");
// DisplayGrid.DisplayValue();
//
//
// unsigned int iRow;
// char cCol;
// std::cout << "Colum and Row: " << std::endl;
// std::cin >> cCol;
// std::cin >> iRow;
// DisplayGrid.RevealCell(iRow,cCol);
//#endif // 0
//Opening code to get grid size and explain game;
MineGrid::Setup();
unsigned int Rows, Cols;
std::cin >> Cols;
std::cin >> Rows;
MineGrid PlayGrid(Cols,Rows);
PlayGrid.GenerateBombs();
PlayGrid.CompleteDisplay();
char cCol;
while (!PlayGrid.isGameOver)
{
printf("Cell to reveal Colum Row (A,0) : ");
std::cin >> cCol;
std::cin >> Rows;
PlayGrid.RevealCell(Rows,cCol);
}
PlayGrid.GameOver();
return 0;
}