|
|
@ -188,7 +188,7 @@ enum bool must_move(const struct player_t player, const struct game_state_t game |
|
|
|
if( (dest = move_calculation( (size_t) hole, j)) != -1) { |
|
|
|
distance1 = distance_to_branch(player.branch, dest); |
|
|
|
if(game.board[dest] == none && distance1 < distance && !pawn_on_branch(((player.branch+2)%6)+1,dest,start_position)) { |
|
|
|
printf("coup qui progresse : %lu (%d) %lu (%d)\n", hole, distance, dest, distance1); |
|
|
|
printf("coup qui progresse : %lu (%d) %lu (%d)\n", (long unsigned int)hole, distance, (long unsigned int)dest, distance1); |
|
|
|
must_move = false; /* on a un coup qui progresse */ |
|
|
|
} |
|
|
|
if(game.board[dest] == player.branch && search(start_position[player.branch-1],10,dest) && distance1 < distance) { |
|
|
@ -198,7 +198,7 @@ enum bool must_move(const struct player_t player, const struct game_state_t game |
|
|
|
if((dest2 = move_calculation(dest,j)) != -1) { |
|
|
|
distance1 = distance_to_branch(player.branch, dest2); |
|
|
|
if(game.board[dest2] == none && distance1 < distance && !pawn_on_branch(((player.branch+2)%6)+1,dest2,start_position)) { |
|
|
|
printf("coup qui progresse : %lu (%d) %lu (%d)\n", hole, distance, dest2, distance1); |
|
|
|
printf("coup qui progresse : %lu (%d) %lu (%d)\n", (long unsigned int)hole, distance, (long unsigned int)dest2, distance1); |
|
|
|
must_move = false; /* on a un coup qui progresse */ |
|
|
|
} |
|
|
|
else if(game.board[dest2] == player.branch && search(start_position[player.branch-1],10,dest2) && distance1 < distance) |
|
|
@ -219,7 +219,7 @@ enum bool must_move(const struct player_t player, const struct game_state_t game |
|
|
|
if( (dest = move_calculation(start_hole, j)) != -1 && game.board[dest] != none && (dest2 = move_calculation(dest,j)) != -1) { |
|
|
|
distance1 = distance_to_branch(player.branch, dest2); |
|
|
|
if(game.board[dest2] == none && distance1 < distance && !pawn_on_branch(((player.branch+2)%6)+1,dest2,start_position)) { |
|
|
|
printf("coup qui progresse : %lu (%d) %lu (%d)\n", hole, distance, dest2, distance1); |
|
|
|
printf("coup qui progresse : %lu (%d) %lu (%d)\n", (long unsigned int)hole, distance, (long unsigned int)dest2, distance1); |
|
|
|
must_move = false; /* on a un coup qui progresse */ |
|
|
|
} |
|
|
|
else if(game.board[dest2] == player.branch && search(start_position[player.branch-1],10,dest2) && distance1 < distance) |
|
|
@ -253,7 +253,7 @@ enum bool must_move(const struct player_t player, const struct game_state_t game |
|
|
|
for(hole=0, player_pawn=0;hole<121 && player_pawn < 10;hole++) |
|
|
|
if(pawn_to_move[hole]) { |
|
|
|
#ifdef debug |
|
|
|
fprintf(stderr, "%lu ", hole); |
|
|
|
fprintf(stderr, "%lu ", (long unsigned int)hole); |
|
|
|
#endif |
|
|
|
res[player_pawn++]=hole; /* le tableau est trié donc on pourra faire une recherche dichotomique */ |
|
|
|
} |
|
|
|