14 cout <<
"\033[H\033[2J";
19 cout <<
"\033[" << Col.c_str () <<
"m";
25 const unsigned KNbLine = Mat.size ();
26 const unsigned KNbCol = Mat[0].size ();
27 cout << string (KNbCol + 2 ,
'-') << endl;
28 for (
unsigned i (0); i < KNbLine; ++i)
54 cout << string (KNbCol + 2 ,
'-') << endl;
66 PosPlayer1.second = NbColumn - 1;
67 Mat [PosPlayer1.first][PosPlayer1.second] =
'X';
68 PosPlayer2.first = NbLine - 1;
70 Mat [PosPlayer2.first][PosPlayer2.second] =
'O';
const char KEmpty
KEmpty : character for an empty cell.
void Color(const string &Col)
std::vector< char > CVLine
CVLine : alias to a line of the matrix.
void ClearScreen()
Clear the current terminal.
std::pair< unsigned, unsigned > CPosition
CPosition : a pair gathering the coordinates in the grid.
std::vector< CVLine > CMat
CMat : alias to a game grid type.
const std::map< std::string, std::string > KColor
KColor : map between the "human" color and its correspondence for the Unix terminal.
void DisplayGrid(const CMat &Mat)
Set of usefull functions for the grid management.
void InitGrid(CMat &Mat, unsigned NbLine, unsigned NbColumn, CPosition &PosPlayer1, CPosition &PosPlayer2)
Definition of usefull types or aliases for the project.