Pour vous relaxer :)
from random import * from math import * from kandinsky import * from time import * w=100 h=100 r,g,b=0,0,0 cw=1 ch=1 fill_rect(0,0,320,222,"black") cr=1 cg=1 cb=1 xc=0 yc=0 while True: fill_rect(int(160-w/2),int(111-h/2),w,h,color(r,g,b)) fill_rect(int(160-w/2)-1,int(111-h/2)-1,w+2,1,color(0,0,0)) fill_rect(int(160-w/2)-1,int(111-h/2)+h,w+2,1,color(0,0,0)) fill_rect(int(160-w/2)-1,int(111-h/2)-1,1,h+2,color(0,0,0)) fill_rect(int(160-w/2)+w,int(111-h/2)-1,1,h+2,color(0,0,0)) if cw==1:w=w+1 if cw==0:w=w-1 if w>320:cw=0 if w<1:cw=1 if ch==1:h=h+1 if ch==0:h=h-1 if h>222:ch=0 if h<-1:ch=1 if cr==1:r=r+randint(0,5)/10 if cg==1:g=g+randint(0,4)/10 if cb==1:b=b+randint(0,3)/10 if cr==0:r=r-randint(0,5)/10 if cg==0:g=g-randint(0,4)/10 if cb==0:b=b-randint(0,3)/10 if r>254:cr=0 if g>254:cg=0 if b>254:cb=0 if r<0:cr=1 if g<0:cg=1 if b<0:cb=1 fill_rect(randint(0,320),randint(0,222),1,1,color(randint(0,255),randint(0,255),randint(0,255))) sleep(0.01)