Appuyez plusieurs fois sur la touche “Retour” à côté de “OK” pour arrêter le script.
from random import * from kandinsky import * from time import sleep nb = 120 st = [0]*nb pr = [0]*nb NR = (0,0,0) def point(): return [randrange(320),0,randrange(1,10)] def init(): fill_rect(0,0,320,222,NR) for i in range(nb): st[i] = point() def go(): init() while True: sleep(.05) for i in range(nb): st[i][1] += randrange(1,int(50/st[i][2])) z = st[i][2] px = st[i][0] py = min(240,st[i][1]) if py >= 240: st[i] = point() if pr[i] != 0: set_pixel(pr[i][0],pr[i][1],NR) pr[i] = [int(px),int(py)] c = int((1 - z/10) * 255) set_pixel(pr[i][0],pr[i][1],color(c,c,c)) go()