laby.py

Created by lorem-ipsum-42

Created on November 15, 2020

896 Bytes


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()

During your visit to our site, NumWorks needs to install "cookies" or use other technologies to collect data about you in order to:

With the exception of Cookies essential to the operation of the site, NumWorks leaves you the choice: you can accept Cookies for audience measurement by clicking on the "Accept and continue" button, or refuse these Cookies by clicking on the "Continue without accepting" button or by continuing your browsing. You can update your choice at any time by clicking on the link "Manage my cookies" at the bottom of the page. For more information, please consult our cookies policy.