From a1c1710a27bdf66add582b7c325b084d91101282 Mon Sep 17 00:00:00 2001
From: "remi.greub" <remi.greub@hes-so.ch>
Date: Mon, 31 Mar 2025 00:42:41 +0200
Subject: [PATCH] =?UTF-8?q?correction=20de=20la=20m=C3=AAme=20erreur=20mai?=
 =?UTF-8?q?s=20pour=20le=20mode=20randbot?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 puissance4_GRB/puissance4.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/puissance4_GRB/puissance4.c b/puissance4_GRB/puissance4.c
index 2b77a4b..50bd5ba 100644
--- a/puissance4_GRB/puissance4.c
+++ b/puissance4_GRB/puissance4.c
@@ -164,7 +164,9 @@ int Launch_puissance4_randBot(int seed){
 	while(winner==EMPTY){
 		print_game();
 		if(game.curr_player == 1){
-			chiffre = rand()%game.width;
+			do{
+				chiffre = rand()%game.width;
+			}while((is_cell_free(chiffre, 0, game.players[game.curr_player].symbol))<0);
 		}else{
 			printf("Column number? (starts at 1):\n");
 			do{
-- 
GitLab