myturtle10.py

Created by vef03715

Created on February 01, 2021

437 Bytes


from math import *
from turtle import *

def knuth(n,a=-90,t=45,h=8):
  if n == 0:
    right(45+t)
    forward(h)
    left(45+t)
    return
  right(2*t + a)
  knuth(n-1,2*t,-t,h)
  right(45-3*t-a)
  forward(h)
  left(45-t+a)
  knuth(n-1,0,-t,h)
  right(a)

def myturtle10():
  reset()
  speed(10)
  penup()
  goto(155,-60)
  pendown()
  left(180)
  knuth(9,h=5)
  penup()
  hideturtle()
  goto(-150,-100)
  write("END")