main()
因为seth是设置绝对角度,所以进入for循环后,seth(120)使得第二段和第三段的倾斜角度相同。
使用 left 或 right 来设置相对角度即可解决
from turtle import *
def main():
setup(200,200,0,0)
seth(0)
for i in range(3):
fd(50)
left(120)
main()
from turtle import *
def main():
setup(200,200,0,0)
seth(0)
jd =120
for i in range(3):
fd(60)#向前60像素
seth(jd)#设置角度为120°
jd += 120
done() #结束,暂停
main()
seth指的是相对坐标轴的绝对角度,可以用left代替