z_episode3.py

Created by cent20

Created on July 09, 2024

396 Bytes

📙 Découvrir la NumWorks p.48
Joue avec ta #NumWorks : épisode 3

Faire passer un message

Sur un fond grisé mais pas uniforme, affiche le message de ton choix.
Dans l’idée il faut produire l’image sans lire ni exploiter le code ci-dessous. https://twitter.com/nsi_xyz/status/1642613542682521602


# [FR] Découvrir la NumWorks .p48 
# [EN]  Discovering the NumWorks p.48 
from kandinsky import set_pixel, draw_string
from random import randint

for x in range(320):
    for y in range(222):
        d = (x-160)**2+(y-111)**2
        c = 442 + d        
        if d < 342:
            c = 255
        set_pixel(x,y, (c,c,c))
        
draw_string('42', 150, 102, (142,42,242))

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.