diff --git a/src/game/morpion.cpp b/src/game/morpion.cpp index e3445cee3c3e53ba93c90aa34e1ba11dbb41cc1c..eaae6d175b70e90056b4d50bea07899a16fd41e4 100644 --- a/src/game/morpion.cpp +++ b/src/game/morpion.cpp @@ -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)