超硬核!!25行代码教你画五星红旗

软件发布|下载排行|最新软件

当前位置:首页IT学院IT技术

超硬核!!25行代码教你画五星红旗

廖志丹   2020-01-31 我要评论
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()

效果图

Copyright 2022 版权所有 软件发布 访问手机版

声明:所有软件和文章来自软件开发商或者作者 如有异议 请与本站联系 联系我们