From 30c49a595215470b34f97c697cc963bc4be4b54b Mon Sep 17 00:00:00 2001 From: Lacroix Raphael Date: Thu, 12 May 2022 19:53:57 +0200 Subject: [PATCH] added random moves - Untested --- PjtKEIL_Integration/Src/principal.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/PjtKEIL_Integration/Src/principal.c b/PjtKEIL_Integration/Src/principal.c index c3bff67..8092cb1 100644 --- a/PjtKEIL_Integration/Src/principal.c +++ b/PjtKEIL_Integration/Src/principal.c @@ -38,15 +38,10 @@ int nCible = 1; void majCible() { Prepare_Clear_LED(nLed); - - nLed++; - nCible++; - if (nCible > 4) { - nCible = 1; - } - if (nLed > 3) { - nLed = 0; - } + + // on utilise le "bruit" de l'entree (capteur) comme source d'aléatoire + nLed=tabJoueur[0].dft % 4; + nCible = nLed +1; Prepare_Set_LED(nLed); Choix_Capteur(nCible);