Python旋转方形递归雪花

旋转方形递归雪花turtle snow flake

旋转方形递归雪花turtle snow flake

"""
   旋转方形递归雪花,这是一个递归图形,画完后它会旋转起来。
   
"""
from turtle import *
 def main():
    """
    主要执行函数
    """
    screen = Screen()
    screen.delay(0)
    screen.setup(480,480)
    screen.bgcolor('black')
    screen.title("Python旋转方形递归雪花 by lixingqiu")
    
    t = Turtle()
    t.color('light blue')
    t.speed(0)
    t.begin_poly()
    draw_flake(t,6,120)
    t.end_poly()
    p = t.get_poly()
    screen.addshape('flake',p)
    t.clear()
    t.shape('flake')
    while True: t.right(1)

def draw_flake(t,n,length):
    """
    画正方形雪花图
    """
    

You must log in to read the rest of this article. Please log in or register as a user.