猫史档案馆


【Python作品分享】draw2.0

用户:RainDawn_SATARainDawn_SATA查看:0 回复:0 评论:0 创建时间:2021-05-01T22:12:57


【作品展示】

center_image

 

【作品介绍】

从矩形到圆形

 

【作品源代码】

import turtle as t
import time


def 喵(cr_1, cr_2, cr_3, dis, m, speed, ps, x, y):

    t.hideturtle()

    t.speed(speed)
    t.pensize(ps)
    t.bgcolor(cr_1)
    t.pencolor(cr_2)
    t.fillcolor(cr_3)

    t.up()
    t.goto(x, y)
    t.down()

    for i in range(m):
        t.forward(dis)
        t.left(360 / m)

    t.clear()


def circle_round(speed, ps, x, y, cr_1, cr_2, cr_3, r, angle):
    t.speed(speed)
    t.pensize(ps)
    t.bgcolor(cr_1)
    t.pencolor(cr_2)
    t.fillcolor(cr_3)

    t.up()
    t.goto(x, y)
    t.down()

    t.begin_fill()
    t.circle(r, angle)
    t.end_fill()

    t.clear()


def end():
    t.write('Thanks!', font=('Arial', 50, 'bold'))

    t.up()
    t.goto(-50, 0)
    t.down()

    time.sleep(1)
    t.clear()

for i in range(20):
    a = i+3
    b = 300/a
    喵("black", "white", "white", b, a, 0, 1, 0, 0)


end()

 

【提示】

部分含有Python第三方库相关内容的作品,在海龟编辑器网页端无法运行哦!如遇到这种情况,可以打开下面的链接,下载海龟编辑器客户端:

https://python.codemao.cn


回复

上一页1 页 / 共 0下一页