-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDisplay.cpp
More file actions
40 lines (38 loc) · 1.18 KB
/
Display.cpp
File metadata and controls
40 lines (38 loc) · 1.18 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
#include "Display.h"
#include "consoletext.h"
#include "Init.h"
#include <iostream>
#include <iomanip>
using namespace std;
void DisplayBoard(Grid &Board)
{
system("cls");
SetBGColor(12);
for (int i = 0; i <= Board.col; i++) {
cout.width(3), cout << left << i;
}
cout.width(3), cout << "y" << endl;
for (int i = 0; i < Board.row; i++)
{
SetBGColor(12);
cout.width(3);
cout << left << i + 1;
SetBGColor(1);
for (int j = 0; j < Board.col; j++)
if (Board.isFlag[i][j]) cout.width(3), cout << left << "F";
else
{
if (!Board.isFlip[i][j]) cout.width(3), cout << left << "U";
else
{
cout.width(3);
if (Board.isMine[i][j]) cout << left << "B";
else cout << left << Board.Board[i][j];
}
}
cout << endl;
}
SetBGColor(12);
cout.width(3), cout << left << 'x' << endl;
SetBGColor(0);
}