ON FIX ENCORE LE CODE DU PROF

This commit is contained in:
Mylloon 2023-04-11 16:00:40 +02:00
parent 2d4c6c1cf9
commit 07a38b5c2b
Signed by: Anri
GPG key ID: A82D63DFF8D1317F

View file

@ -246,8 +246,14 @@ bool bt_t::mcts_simulation(void) {
// then play randomly 'til the game is over // then play randomly 'til the game is over
while (endgame() == EMPTY) { while (endgame() == EMPTY) {
bt_move_t m = get_rand_move(); update_moves();
if (nb_moves > 0) {
int r = (static_cast<int>(rand())) % nb_moves;
bt_move_t m = moves[r];
play(m); play(m);
} else {
break;
}
} }
// if i won // if i won