From 9735160458e9c20711d92b87dcff1bf0c1faef27 Mon Sep 17 00:00:00 2001 From: "remi.greub" <remi.greub@hes-so.ch> Date: Sat, 29 Mar 2025 23:38:02 +0100 Subject: [PATCH] =?UTF-8?q?ajout=20des=203=20modes=20dans=20le=20main=20(t?= =?UTF-8?q?est=C3=A9s=20et=20approuv=C3=A9s)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- puissance4_GRB/main.c | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/puissance4_GRB/main.c b/puissance4_GRB/main.c index 20a6205..ba26748 100644 --- a/puissance4_GRB/main.c +++ b/puissance4_GRB/main.c @@ -18,14 +18,28 @@ int main(int argc, char** argv){ }else{ width = atoi(argv[3]); } + int win = 0; printf("Board size is %dx%d (rows x col)\n",height,width); init_puissance4(height, width); - //print_game(); - //print_gameCells(); - int win = Launch_puissance4(); - //printf("\nle winner c'est ça la : %d\n",win); - //ici on va gérer probablement si on veut mettre a jour un score et relancer une nouvelle partie jusqu'à ce que l'utilisateur veut arrêter + switch (mode) + { + case 1: + + win = Launch_puissance4_randBot(0); + break; + case 2: + win = Launch_puissance4_smartBot(0); + break; + case 3: + win = Launch_puissance4(); + break; + + default: + printf("t'as pas rentré un mode valide ! c'est 1, 2 ou 3\n"); + return EXIT_FAILURE; + + } return EXIT_SUCCESS; } -- GitLab