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

Corrected some compilation errors

parent cf6a9635
No related branches found
No related tags found
No related merge requests found
......@@ -73,10 +73,10 @@ namespace game
int morpion::value(uint8_t player) const
{
if (player == CROSS) {
return state.first_player_win? 1 : (state.second_player_win? -1 : 0)
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 state.second_player_win? 1 : (state.first_player_win? -1 : 0);
}
return 0;
}
......@@ -86,7 +86,7 @@ namespace game
return state.total_moves;
}
bool morpion::get(uint64_t bitboard, uint8_t col, uint8_t row) const
bool morpion::get(uint16_t bitboard, uint8_t col, uint8_t row) const
{
return bitboard & (1LL << (3*row)) << col;
}
......@@ -112,16 +112,17 @@ namespace game
return false;
}
/*
void morpion::update_moves(uint16_t move)
{
//TODO: Implement
}
*/
void morpion::play(uint16_t m) // not finished
void morpion::play(uint16_t m)
{
uint16_t bitboard = cross_bitboard | circle_bitboard;
if(current_player() == CROSS)
uint16_t bitboard = state.cross_bitboard | state.circle_bitboard;
return;
}
......@@ -140,7 +141,7 @@ namespace game
{
uint8_t row = m/3;
uint8_t col = m%3;
return "( "std::to_string(row)", "std::to_string(col)" )";
return "( "+std::to_string(row)+", "+std::to_string(col)+" )";
}
......@@ -155,8 +156,9 @@ namespace game
string morpion::to_string() const
{
for (int i = 0
//for (int i = 0
//TODO PAR ROMAIN
return "";
}
void morpion::playout(mt19937& engine, int max_depth)
......
......@@ -49,7 +49,7 @@ namespace game
inline void update_win(); //Check if someone won and update the state
inline bool has_won(uint16_t bitboard); //Check if the player whose bitboard was passed as a param has won
inline bool get(uint16_t bitboard, uint8_t i, uint8_t j) const; //Get a case of the board
const uint8_t CROSS = 0;
const uint8_t CIRCLE = 1;
......
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