叠加等边三角形绘制

import turtle as t
t.setup(600, 600, None,None)
t.pu()
t.fd(-120)
t.pensize(2)
t.width(2)
t.pencolor("green")
t.pd()
t.fd(250)
t.seth(120)
t.pencolor("green")
t.fd(250)
t.seth(-120)
t.pencolor("green")
t.fd(250)
t.pencolor("blue")
t.fd(250)
t.seth(0)
t.pencolor("blue")
t.fd(250)
t.pencolor("red")
t.fd(250)
t.seth(120)
t.pencolor("red")
t.fd(250)
t.seth(-120)
t.pencolor("red")
t.fd(250)
t.seth(120)
t.pencolor("blue")
t.fd(250)

猜你喜欢

转载自www.cnblogs.com/dxdqy/p/12459611.html