from kandinsky import * from random import choice red, green, blue = [], [], [] for a in range(0, 255, 8): red.append(a) for b in range(0, 255, 4): green.append(b) for c in range(0, 255, 8): blue.append(c) def create_laby(): global couleur color_liste = [] for j in range (11, 212, 20): for x in range(60, 261, 1): set_pixel(x, j, (0, 0, 0)) for i in range (60, 261, 20): for y in range(11, 212, 1): set_pixel(i, y, (0, 0, 0)) for ordonnee in range (12, 211, 20): for abscisse in range (61, 260, 20): couleur = (choice(red), choice(green), choice(blue)) if couleur in color_liste: couleur = (choice(red), choice(green), choice(blue)) color_liste.append(couleur) fill_rect(abscisse, ordonnee, 19, 19, (couleur)) create_laby()