--il n'y a aucune fonction --declaration des variables x=0 y=0 clear(0) y=misc.random(100) --fonction aleatoire y=? repeat --repetition du bloc jusqu'a que x=y if key(40) then x=x+1 -- ajout de 1 a x else if key(37) then x=x-1 --retrait de 1 a x end end nbdraw.setcursor(2,1)nbdraw.print("choisir un nombre :") nbdraw.setcursor(2,20)nbdraw.print(x) misc.wait(4) if x>=1 or x<=-1 --valeur ou ca n'efface pas l'ecran then clear(0) end nbdraw.setcursor(4,1)if key(1)and xy then nbdraw.print("essai encore et c'est moins") end if x<0 then x=0 else if x>99 then x=99 end end if key(41) and key(20) then break end until key(1) and x==y clear( 0 ) nbdraw.setcursor(4,8)--résultat du nombra a trouver nbdraw.print("GAGNE") nbdraw.setcursor(7,1) nbdraw.print("la reponse est") nbdraw.setcursor(7,17) nbdraw.print(y) misc.wait(300)