From 77f8cc5cc769875cc8b55794114e55feead51f27 Mon Sep 17 00:00:00 2001 From: "remi.greub" <remi.greub@hes-so.ch> Date: Sat, 29 Mar 2025 23:09:41 +0100 Subject: [PATCH] =?UTF-8?q?am=C3=A9lioration=20du=20smartBot?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- puissance4_GRB/puissance4.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/puissance4_GRB/puissance4.c b/puissance4_GRB/puissance4.c index 6354c87..58bc30f 100644 --- a/puissance4_GRB/puissance4.c +++ b/puissance4_GRB/puissance4.c @@ -362,6 +362,7 @@ int SmartBot(){ //verifie que le coup est jouable if((pos = put_free_cell(chfr, game.players[game.curr_player].symbol))>=0){ struct cell *tempCell = &game.cells[chfr][pos]; + tempCell->symbol = game.players[game.curr_player].symbol; if (Find_winner(game.cells, game.cells[chfr][pos]) == game.players[game.curr_player].symbol){ //1er cas : a trouvé le bon coup à jouer pour gagner tempCell->symbol = EMPTY; @@ -374,6 +375,7 @@ int SmartBot(){ tempCell->symbol = EMPTY; return chfr; } + tempCell->symbol = EMPTY; } } //3e cas : joue un coup au hasard -- GitLab