diff --git a/src/game/morpion.cpp b/src/game/morpion.cpp index 2d0ff85f8db1229f5212ac05b56af01744773531..3679d16a1802b8d7a889ad9bc9c44a516e52eba7 100644 --- a/src/game/morpion.cpp +++ b/src/game/morpion.cpp @@ -173,9 +173,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)