from time import * from kandinsky import * from random import * from ion import * rq="q" p=10 l=[("tres facile",50,11),("facile",15,6),("moyen",10,5),("difficile",5,9),("tres difficile",1,14)] c=2 a="" for x in range(0,320,10):fill_rect(x,0,10,222,color(randint(0,255),randint(0,255),randint(0,255))) fill_rect(58,78,204,84,"black") fill_rect(60,80,200,80,"white") while True: if keydown(KEY_RIGHT) and c<4: while keydown(KEY_RIGHT):pass c=c+1 for x in range(0,320,10):fill_rect(x,0,10,222,color(randint(0,255),randint(0,255),randint(0,255))) fill_rect(58,78,204,84,"black") fill_rect(60,80,200,80,"white") if keydown(KEY_LEFT) and c>0: while keydown(KEY_LEFT):pass c=c-1 for x in range(0,320,10):fill_rect(x,0,10,222,color(randint(0,255),randint(0,255),randint(0,255))) fill_rect(58,78,204,84,"black") fill_rect(60,80,200,80,"white") a=l[c][0] p=l[c][1] draw_string("Appuyer sur [OK]",80,100) draw_string("< "+str(a)+" >",140-l[c][2]*5,130) if keydown(KEY_OK): while keydown(KEY_OK):pass break while True: if rq=="q": case=randint(1,10) r=randint(0,255-p) g=randint(0,255-p) b=randint(0,255-p) for x in range(0,290,32): fill_rect(x-2,0,4,222,"white") if case*32-32!=x:fill_rect(x,0,32,222,color(r,g,b)) else:fill_rect(x,0,32,222,color(r+p,g+p,b+p)) fill_rect(0,0,2,222,"white") fill_rect(318,0,2,222,"white") while True: if keydown(KEY_OK): while keydown(KEY_OK):pass rq="r" break if rq=="r": for y in range(0,222,2): for x in range(0,290,32): if case*32-32!=x:fill_rect(x,y,32,2,color(r,g,b)) else:fill_rect(x,y,32,222,color(r+p,g+p,b+p)) draw_string("X",case*32-21,110,"white",color(r+p,g+p,b+p)) while True: if keydown(KEY_OK): while keydown(KEY_OK):pass rq="q" break