Skip to content
Snippets Groups Projects
Commit def0b7f0 authored by Romain Lebouc's avatar Romain Lebouc
Browse files

Implemented function to_string

String representation of the whole board
parent 2206bbd9
No related branches found
No related tags found
No related merge requests found
......@@ -156,9 +156,22 @@ namespace game
string morpion::to_string() const
{
//for (int i = 0
//TODO PAR ROMAIN
return "";
string result = "";
for (int row = 2; row >= 0; row--)
{
result += "|"
for (int col = 2; col >= 0; col--)
{
if(((state.cross_bitboard >> 3*row) >> col) & 1)
result += player_to_string(CROSS)+"|";
else if (((state.circle_bitboard >> 3*row) >> col) & 1)
result += player_to_string(CIRCLE)+"|";
else
result += " |";
}
result += "\n-------\n";
}
return result;
}
void morpion::playout(mt19937& engine, int max_depth)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment