saucisse.py

Created by pierre-cendret

Created on April 09, 2026

431 Bytes


from kandinsky import set_pixel
import math

a = 50
r = 20

cx = 160
cy = 111

xmin = max(0, cx - a - r)
xmax = min(320, cx + a + r)
ymin = max(0, cy - r)
ymax = min(222, cy + r)

for x in range(xmin, xmax):
    for y in range(ymin, ymax):
        dx = x - cx
        dy = y - cy

        qx = max(abs(dx) - a, 0)
        d = math.sqrt(qx*qx + dy*dy) - r

        if d <= 0:
            set_pixel(x, y, (255, 0, 0))

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.