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

Implementation of the penguin_move_board fonction

parent 0325ef1c
No related branches found
No related tags found
No related merge requests found
ai_vs_ai=1
ai_think_time=5000
ai_vs_ai_game_count=100
heuristic_ai_1=default
heuristic_ai_1=points
heuristic_ai_2=default
send_game_to_gui=1
......@@ -526,6 +526,36 @@ namespace game
return board;
}
uint64_t pengin::penguin_move_board(const uint32_t& pen) const
{
uint64_t board = 0;
//Direction A
for(int i=1; i<= PENGUIN_MOVES_A(pen); i++){
board |= ((uint64_t)1 << PENGUIN_POS(pen) + i*7);
}
//Direction B
for(int i=1; i<= PENGUIN_MOVES_B(pen); i++){
board |= ((uint64_t)1 << PENGUIN_POS(pen) + i*(-1));
}
//Direction C
for(int i=1; i<= PENGUIN_MOVES_C(pen); i++){
board |= ((uint64_t)1 << PENGUIN_POS(pen) + i*(-8));
}
//Direction D
for(int i=1; i<= PENGUIN_MOVES_D(pen); i++){
board |= ((uint64_t)1 << PENGUIN_POS(pen) + i*(-7));
}
//Direction E
for(int i=1; i<= PENGUIN_MOVES_E(pen); i++){
board |= ((uint64_t)1 << PENGUIN_POS(pen) + i*1);
}
//Direction F
for(int i=1; i<= PENGUIN_MOVES_A(pen); i++){
board |= ((uint64_t)1 << PENGUIN_POS(pen) + i*8);
}
return board;
}
uint8_t penguin::turns_played() const
{
uint8_t played = 0;
......
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