Skip to content
Snippets Groups Projects
Commit 28260a32 authored by Felton Samuel's avatar Felton Samuel
Browse files

fixed (hopefully) penguin_board function

parent 239e7ec5
No related branches found
No related tags found
No related merge requests found
......@@ -517,17 +517,12 @@ namespace game
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;
}
}
uint32_t* tab = color ? state.peng_blue : state.peng_red;
for (int i = 0; i<4 ; i++){
board |= (uint64_t) 1 << tab[i];
std::cout << PENGUIN_POS(tab[i]) << " : " << board << std::endl;
}
return board;
}
}
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