Skip to content
Snippets Groups Projects
Commit c70919d0 authored by Bariatti Francesco's avatar Bariatti Francesco
Browse files

Added toString

parent d1cbcd4e
No related branches found
No related tags found
No related merge requests found
...@@ -366,8 +366,7 @@ namespace game ...@@ -366,8 +366,7 @@ namespace game
string penguin::move_to_string(uint16_t m) const string penguin::move_to_string(uint16_t m) const
{ {
//return std::to_string((state.possible_moves >> (4 * m)) & 0xf); return std::to_string(m);
return "TODO";
} }
set<int> penguin::to_input_vector() const set<int> penguin::to_input_vector() const
...@@ -381,24 +380,26 @@ namespace game ...@@ -381,24 +380,26 @@ namespace game
string penguin::to_string() const string penguin::to_string() const
{ {
/*string result = "-------\n"; string result= "--------------------";
for (int row = 2; row >= 0; row--) result += "\n1 fish bro: " + std::to_string(state.one_fish);
{ result += "\nTwo fishes: " + std::to_string(state.two_fish);
result += "|"; result += "\nThree fish: " + std::to_string(state.three_fish);
for (int col = 2; col >= 0; col--) result += "\nRed p1: " + std::to_string(state.p1_red);
{ result += "\nRed p2: " + std::to_string(state.p2_red);
if(((state.cross_bitboard >> (3*row)) >> col) & 1) result += "\nRed p3: " + std::to_string(state.p3_red);
result += player_to_string(CROSS)+"|"; result += "\nRed p4: " + std::to_string(state.p4_red);
else if (((state.circle_bitboard >> (3*row)) >> col) & 1) result += "\nBlue p1: " + std::to_string(state.p1_blue);
result += player_to_string(CIRCLE)+"|"; result += "\nBlue p2: " + std::to_string(state.p2_blue);
else result += "\nBlue p3: " + std::to_string(state.p3_blue);
result += std::to_string(row * 3 + col) + "|"; result += "\nBlue p4: " + std::to_string(state.p4_blue);
}
result += "\n-------\n"; result += "\nScore R: " + std::to_string(state.score_red);
} result += "\nScore B: " + std::to_string(state.score_blue);
result += "\nNb possible moves R:" + std::to_string(state.nb_moves_red);
result += "\nNb possible moves B:" + std::to_string(state.nb_moves_blue);
return result; return result;
*/
return "TODO";
} }
std::uint64_t penguin::hash() const std::uint64_t penguin::hash() const
......
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