14 cout <<
"\033[H\033[2J";
17 void Color (
const string & Col)
19 cout <<
"\033[" << Col.c_str () <<
"m";
27 cout << string (4,
' ');
28 for (
unsigned i (0); i < Mat.size (); ++i)
32 cout << setw (2) << i;
35 cout<< setw (2) <<
'|';
38 string Rule (4*Mat.size () + 1,
'=');
39 Rule = string (3,
' ') + Rule;
44 unsigned LineNumber (0);
45 for (
const CVLine & Aline : Mat)
50 cout << setw (2) << LineNumber++;
54 for (
auto Cel : Aline)
65 cout<< setw (2) <<
'|';
69 cout << endl << Rule << endl;
78 cout << string (4,
' ');
79 for (
unsigned i (0); i < Mat.size (); ++i)
80 cout << setw (2) << i << setw (2) <<
'|';
82 string Rule (4*Mat.size () + 1,
'=');
83 Rule = string (3,
' ') + Rule;
85 unsigned LineNumber (0);
86 for (
const CVLine & Aline : Mat)
88 cout << setw (2) << LineNumber++ <<
'|';
90 for (
auto Cel : Aline)
91 cout << setw (2) << Cel << setw (2) <<
'|';
92 cout << endl << Rule << endl;
108 string Rule (4*Mat.size () + 1,
'=');
109 cout << Rule << endl;
110 for (
const CVLine & Aline : Mat)
113 for (
auto Cel : Aline)
114 cout << setw (2) << Cel << setw (2) <<
'|';
115 cout << endl << Rule << endl;
123 for (
auto & Line : Grid)
126 for (
auto & Cel : Line)
void DisplayGridWithLineAndColumnNumbers(const CMat &Mat)
Display the grid showing the line and the column numbers.
std::vector< unsigned > CVLine
CVLine : alias to a line of the matrix.
std::map< std::string, std::string > MapParamString
void ClearScreen()
Clear the current terminal.
const unsigned KImpossible
KImpossible :
void Color(const std::string &Col)
Set the color of the future input in the terminal.
void DisplayGrid(const CMat &Mat, const CMyParam &Params, bool ShowLineNumber=true, bool ShowColor=true)
Display the grid according to the parameters.
Struct containing all the game's parameters.
void DisplayGridWithLineAndColumnNumbersAndColor(const CMat &Mat, const CMyParam &Params)
Display the grid showing the line and the column numbers. Everything is colored according to the set ...
Paramters' definition and associated functions.
std::vector< CVLine > CMat
CMat : alias to a game grid type.
void InitGrid(CMat &Grid, const unsigned &Size)
Initialize the grid according to the size.
const std::map< std::string, std::string > KColor
KColor : map between the "human" color and its correspondence for the Unix terminal.
Set of usefull functions for the grid management.
unsigned Rand()
Return a random number between 1 and KNbCandies.
Definition of usefull types or aliases for the project.