from kandinsky import * from math import * t = 1 COUL = "white", "black" nbCOUL = len(COUL) def f(c, l): return 10 * cos(c ^ l) for c in range(320 // t): for l in range(222 // t + 1): y = int(f(c, l)) co = COUL[bin(y).count("1") % nbCOUL] fill_rect(c * t, l * t, t, t, co)