设为首页 加入收藏

TOP

Python3 turtle安装和使用教程(二)
2019-04-04 02:07:54 】 浏览:533
Tags:Python3 turtle 安装 使用 教程
= ['blue', 'red', 'green', 'yellow', 'violet', 'orange', 'white',]


    draw_triangle(points, color_map[degree], t)


    if degree > 0:
        sierpinski([points[0], get_mid(points[0], points[1]), get_mid(points[0], points[2])], degree - 1, t)


        sierpinski([points[1], get_mid(points[0], points[1]), get_mid(points[1], points[2])], degree - 1, t)


        sierpinski([points[2], get_mid(points[0], points[2]), get_mid(points[1], points[2])], degree - 1, t)


if __name__ == "__main__"
    t = turtle.Turtle()
    t.speed(5)
    win = turtle.Screen()


    points = [[-100, -50], [0, 100], [100, -50]]
    sierpinski(points, 3, t)


    win.exitonclick()


py代码可以到Linux公社资源站下载:


------------------------------------------分割线------------------------------------------


具体下载目录在 /2019年资料/4月/3日/Python3 turtle安装和使用教程/


------------------------------------------分割线------------------------------------------


首页 上一页 1 2 下一页 尾页 2/2/2
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
上一篇Python turtle绘制数码管显示当前.. 下一篇Linux下动态链接的步骤与实现详解

最新文章

热门文章

Hot 文章

Python

C 语言

C++基础

大数据基础

linux编程基础

C/C++面试题目