Skip to content
Snippets Groups Projects
Commit 2274d2f1 authored by Bariatti Francesco's avatar Bariatti Francesco
Browse files
parents 05aa17ae 566f9a27
No related branches found
No related tags found
No related merge requests found
......@@ -74,7 +74,12 @@ namespace game
int morpion::value(uint8_t player) const
{
//TODO: Implement
if (player == CROSS) {
return state.first_player_win? 1 : (state.second_player_win? -1 : 0)
}
else if (player == CIRCLE) {
return state.second_player_win? 1 : (state.first_player_win? -1 : 0)
}
return 0;
}
......@@ -111,17 +116,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
......@@ -135,8 +148,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)
......
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