voici une fractale
import kandinsky as k, cmath as m, ion L, H = 320, 220 c = complex(-0.4, 0.6) params = [-1.8, 1.8, -1.2, 1.2, 50] while True: xm, xx, ym, yx, imax = params for x in range(L): for y in range(H): z = complex(xm + x/L*(xx-xm), ym + y/H*(yx-ym)) i = imax for n in range(imax): if abs(z) > 2: i = n; break z = z**2 + c if i == imax: col = (0,0,0) else: h = (i * 15) % 256 r,g,b=[int(128+127*m.sin(h*.0245+d).real) for d in [0,3,6]] col = (r,g,b) k.set_pixel(x, y, k.color(*col)) while not ion.keydown(ion.KEY_PLUS): pass w, h = params[1] - params[0], params[3] - params[2] params[0] += w / 4 params[1] -= w / 4 params[2] += h / 4 params[3] -= h / 4 params[4] += 15 # Augmente les détails pour le zoom