from kandinsky import * from random import * from time import sleep COUL = ((24,40,80),(248,240,24),(248,200,168),(253,160,0)) gp,fr,rd=get_pixel,fill_rect,randint def sp(p,c): fr(2*p[0],2*p[1],2,2,COUL[c]) def alea(n):return [rd(75,85),rd(0,n),rd(1,2)] fr(0,0,320,222,COUL[0]) fr(0,190,320,4,COUL[3]) s=[alea(90) for _ in range(200)] while True: for (i,p) in enumerate(s): sp(p,0) m=0 for j in 0,2,-2: if gp(2*p[0]+j,2*p[1]+2)==COUL[0]: s[i][0]+=j; s[i][1]+=2 m=1 sp(p,p[2]) if m==0: if random()<.5:sp(p,3) s[i]=alea(3) sleep(.02)