From addad0a9134ae32be855cd91b3cbe0fdd8cf2a0d Mon Sep 17 00:00:00 2001 From: Romain Lebouc <rlebouc@insa-rennes.fr> Date: Tue, 20 Oct 2015 12:11:32 +0200 Subject: [PATCH] =?UTF-8?q?methodes=20move=5Fto=5Fstring=20et=20player=5Ft?= =?UTF-8?q?o=5Fstring=20ajout=C3=A9es.=20to=5Fstring=20=C3=A0=20finir.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/game/morpion.cpp | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/src/game/morpion.cpp b/src/game/morpion.cpp index 738afac..b969dcf 100644 --- a/src/game/morpion.cpp +++ b/src/game/morpion.cpp @@ -112,17 +112,25 @@ namespace game { //TODO: Implement } - + + + /** + * player_to_string + * Retourne X si le joueur joue les croix, O s'il joue les ronds, + * et un espace sinon. + */ string morpion::player_to_string(uint8_t player) const { - //TODO: Implement - return "TODO"; + return player == CROSS ? "X" : (player == CIRCLE ? "O" : " "); } - + + string morpion::move_to_string(uint16_t m) const { - //TODO: Implement - return "TODO"; + uint8_t row = m/3; + uint8_t col = m%3; + return "( "std::to_string(row)", "std::to_string(col)" )"; + } set<int> morpion::to_input_vector() const @@ -136,8 +144,8 @@ namespace game string morpion::to_string() const { - //TODO: Implement - return "TODO"; + for (int i = 0 + //TODO PAR ROMAIN } void morpion::playout(mt19937& engine, int max_depth) -- GitLab