-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdraw.cpp
63 lines (46 loc) · 928 Bytes
/
draw.cpp
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
#include "draw.h"
#ifdef _WIN32
#define clear system("cls")
#else
#define clear system("clear")
#endif
draw::draw()
{
clear;
}
draw::~draw()
{
clear;
}
bool draw::init()
{
cout << "\n";
cout << "\n";
for (int i = 0; i < 5; i++)
{
cout << "\t" << ref_bd[i] << "\t\t|\t" << print_bd[i] << "\n";
}
cout << "\n";
return true;
}
bool draw::update()
{
clear;
char** bd = board::check_board();
for (int i = 0; i < 3; i++)
{
print_bd[2 * i][1] = bd[i][0];
print_bd[2 * i][5] = bd[i][1];
print_bd[2 * i][9] = bd[i][2];
}
cout << "\n";
// cout << "\tThis is the reference \t | This board shows the game progress\n";
// cout << "\tboard for input";
cout << "\n";
for (int i = 0; i < 5; i++)
{
cout << "\t" << ref_bd[i] << "\t\t|\t" << print_bd[i] << "\n";
}
cout << "\n";
return true;
}