from kandinsky import * import time x = 0 y = 50 cC = 40 eC = 5 decC = cC + eC nbCarre = 320 // decC def forme(x,y,R,G,B): fill_rect(x,y,12,40,color(R,G,B)) fill_rect(x,y+100,8,20,color(R,G,B)) nbTour = 10 while nbTour > 0: for i in range(nbCarre): fill_rect(x+i*decC,y,cC,cC,color(0,0,0)) forme(x+i*decC,y,0,0,0) time.sleep(0.2) fill_rect(x+i*decC,y,cC,cC,color(255,255,255)) forme(x+i*decC,y,255,255,255) for i in range(nbCarre): fill_rect(x+(nbCarre-1-i)*decC,y,cC,cC,color(0,0,0)) forme(x+(nbCarre-1-i)*decC,y,0,0,0) time.sleep(0.2) fill_rect(x+(nbCarre-1-i)*decC,y,cC,cC,color(255,255,255)) forme(x+(nbCarre-1-i)*decC,y,255,255,255) nbTour = nbTour - 1