def Main(n): '''Boucle principale''' global X,Y,Partie,NBcoups,NBtouches,LB LB = compo(n) grille() ca(X,Y,G) print(Partie) while Partie: t = wait([0,1,2,3,4,]) if t == 3 and X+1<10: majcase(X,Y,X+1,Y) X+=1 elif t == 0 and X>0: majcase(X,Y,X-1,Y) X-=1 elif t == 1 and Y>0: majcase(X,Y,X,Y-1) Y-=1 elif t == 2 and Y+1<10: majcase(X,Y,X,Y+1) Y+=1 elif t == 4: touche(X,Y) ds("Coups",255,10,Bl) ds(str(NBcoups),255,30) ds("Touches",251,50,R) ds(str(NBtouches),255,70)