Skip to content
Snippets Groups Projects
Commit 239e7ec5 authored by Salard Xavier's avatar Salard Xavier
Browse files

Creation of the penguin_board function, still a few things to debug in it

parent 9ceaa2ef
No related branches found
No related tags found
No related merge requests found
......@@ -63,6 +63,10 @@ namespace game
state.canPlay_blue = false;
state.nb_moves_blue = 1; //We create an artificial move so that the mcts works
}
std::cout << penguin_board(BLUE) << std::endl;
std::cout << penguin_board(RED) << std::endl;
}
penguin::penguin(bool b)
{
......@@ -509,4 +513,21 @@ namespace game
return s;
}
uint64_t penguin::penguin_board(bool color){
//A penguin alone on the case 0 correspond to a bitboard which value is 1
uint64_t board = 0ULL;
if (!color){
for (int i = 0; i<4 ; i++){
board |= (((uint64_t) 1 ) << ( (uint64_t)(state.peng_red[i]) & 63 ));
std::cout << PENGUIN_POS(state.peng_red[i]) << " : " << board << std::endl;
}
} else {
for (int i = 0; i<4 ; i++){
board |= ( ((uint64_t) 1 ) << ( (uint64_t)(state.peng_blue[i]) & 63 ));
std::cout << PENGUIN_POS(state.peng_blue[i]) << " : " << board << std::endl;
}
}
return board;
}
}
......@@ -79,6 +79,7 @@ namespace game
*/
const tile_content get_tile(std::uint8_t tile_index) const;
static penguin_state random_start_state();
std::uint64_t penguin_board(bool); // true for position of blue penguin, else false
private:
penguin_state state;
......
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