超硬核!!25行代码教你画五星红旗
import turtle as t
def pic(x,y,w,jd):
t.speed(10)
t.penup()
t.goto(x,y)
t.pendown()
t.color("yellow")
i=5
t.begin_fill()
t.setheading(jd)
while i>0:
t.fd(w)
t.right(144)
i-=1
t.end_fill()
t.hideturtle()
if __name__ == "__main__":
t.setup(720,480)
t.bgcolor("red")
pic(-260,100,80,0)
pic(-110,200,40,305)
pic(-90,120,40,30)
pic(-90,60,40,5)
pic(-110,20,40,300)
t.done()
效果图
版权声明:本文为liaozhidan原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。