cercle_avec_kandinsky.py

Created by elodie-gamot

Created on September 28, 2021

367 Bytes

Tracer un cercle avec kandinsky


from math import *
from kandinsky import *
from random import *

background=color(240,240,240)
surprise=color(randint(0,255),randint(0,255),randint(0,255))

fill_rect(0,0,320,222,background)

for i in range(320):
  for j in range(220):
    if (i-160)**2+(j-110)**2>1800 and (i-160)**2+(j-110)**2<2200:
      set_pixel(i,j,surprise)

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.