derviche.py

Created by bilouclic

Created on October 10, 2024

512 Bytes


import turtle as tl

def polygone(nbCote, lgCote) :
  angle = 360 / nbCote       # Ecriture simplifiée de 180 - (180 - 360/nbCote)
  def dessin(n) :
    if(n > 0) :
      tl.forward(lgCote)
      tl.right(angle)
      dessin(n-1)
  dessin(nbCote)


def dervicheTourneur(nbTour, n, lg) :
  angle = 360 / nbTour
  def tourne(t) :
    if t > 0 :
      polygone(n, lg)
      tl.right(angle)
      tourne(t-1)
  tourne(nbTour)

tl.hideturtle()
tl.speed(0)
dervicheTourneur(10, 5, 40)
tl.exitonclick()

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.