z_episode1.py

Created by cent20

Created on July 09, 2024

590 Bytes

📙 Découvrir la NumWorks p.46
Joue avec ta #NumWorks : épisode 1

Remplir ton écran avec des rectangles aléatoires.

Soyez malin, il n’y a pas vraiment de règles à respecter pour ce premier épisode.
Dans l’idée il faut reproduire l’image sans lire ni exploiter le code ci-dessous. https://twitter.com/nsi_xyz/status/1641897276326006786


# [FR] Découvrir la NumWorks p.46 
# [EN]  Discovering the NumWorks p.46 
# Joue avec ta NumWorks : episode 1
# https://twitter.com/nsi_xyz/status/1641897276326006786
from kandinsky import fill_rect
from random import randint

def color():
    return randint(42,242)

r = g = b = color
x = y = xl = yl = randint

for _ in range(1024):
    #  RECTANGLE  coordonnées (x,y)    largeur   hauteur   couleurs (r,g,b)       
    #  RECTANGLE  coordinates (x,y)    width     height    colors (r,g,b)  
    fill_rect( x(-10,320), y(-10,222), xl(1,42), yl(1,42), (r(), g(), b()) )

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.