-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathVisuals.cpp
More file actions
43 lines (39 loc) · 826 Bytes
/
Copy pathVisuals.cpp
File metadata and controls
43 lines (39 loc) · 826 Bytes
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
#include "Visuals.hpp"
char Visuals::toChar(States state , int place)
{
switch(state)
{
case -1:
return 'X';
break;
case 1:
return 'O';
break;
default:
return place;
}
}
void Visuals::printGameBoard(States theGame[3][3])
{
{
for(int p=0;p<19;p++)
{
std::cout<<"-";
}
std::cout<<std::endl;
for(int i=0;i<3;i++)
{
std::cout<<"| ";
for(int j=0;j<3;j++)
{
std::cout<<Visuals::toChar(theGame[i][j] , 3*i+j+1 + '0')<<" | ";
}
std::cout<<std::endl;
for(int p=0;p<19;p++)
{
std::cout<<"-";
}
std::cout<<std::endl;
}
}
}