【发布时间】:2019-05-20 16:37:31
【问题描述】:
import turtle as t
t.setup(500,500)
t.setworldcoordinates(0,0,500,500)
t.pu()
t.goto(0,0)
t.pd()
t.seth(0)
def N():
t.pu()
t.pd()
def B(c,d):
t.right(90)
c
t.forward(5)
t.left(90)
d
t.forward(5)
d
t.left(90)
t.forward(5)
c
t.right(90)
def A(a,b):
t.left(90)
b
t.forward(5)
t.right(90)
a
t.forward(5)
a
t.right(90)
t.forward(5)
b
t.left(90)
t.seth(0)
A(A(None,None),B(None,None))
我正在尝试制作希尔伯特曲线,但它不起作用。 我正在使用L-system
【问题讨论】:
-
请分享您遇到的错误以及所需的输出 - “为什么这不起作用”还不够
-
您将
a,b,c,d全部作为None提供给您的函数,然后将它们作为无操作放入其中...为什么?你声明了def N(),但从不使用它——为什么?
标签: python python-2.7 turtle-graphics fractals