boule3d.py

Created by schraf

Created on July 23, 2022

380 Bytes


from math import sqrt
from kandinsky import fill_rect,set_pixel,get_pixel
def ligne(w,y):
 for x in range(-w, w):
  v=sum(get_pixel(160+x,y))
  set_pixel(160+x,y,(0,0,0) if v else (255,255,255))
for x in range(0,1279,2):
 t=x/1279
 f=(t*33)%1
 if f>t:fill_rect(x//4,0,1,222,(0,0,0))
r=75
for y in range(0,r):
  w=int(sqrt(r*r-y*y))
  ligne(w,110+y)
  ligne(w,109-y)

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 <a href="https://www.numworks.com/legal/cookies-policy/">cookies policy</a>.