猫史档案馆


《积木创造》不喜勿喷

用户:浮躁的飓风雀HYKa浮躁的飓风雀HYKa查看:0 回复:0 评论:0 创建时间:2021-01-30T15:46:43


import turtle
import easygui

t = turtle.Pen()

def duaw(color,name):
    t = turtle.Pen()
    t.hideturtle()
    t.pendown()
    t.pencolor(color)
    t.goto(0, 0)
    t.dot(100)
    t.setheading(15)
    t.fillcolor(color)
    t.begin_fill()
    t.forward(80)
    t.setheading(165)
    t.circle(25, (-180))
    t.setheading((-90))
    t.forward(2)
    t.setheading(15)
    t.backward(80)
    t.end_fill()
    t.pencolor('white')
    t.penup()
    t.setheading(0)
    t.goto(0, 0)
    t.dot(85)
    t.pencolor(color)
    t.goto((-35), (-35))
    t.write(name[0], font = ('Arial', 50, 'bold'))

easygui.msgbox('第2次查看时可能会有点卡,但是积木的显示是没问题的。')
while True:
    get_input = turtle.textinput('对话框', '你要什么Kitten积木盒子呢?(中文)')
    t.clear()
    try:
        if ('事件' in get_input):
            duaw('blue', '事件')
        elif ('控制' in get_input):
            duaw('skyblue', '控制')
        elif ('动作' in get_input):
            duaw('red', '动作')
        elif ('外观' in get_input):
            duaw('purple', '外观')
        elif ('变量' in get_input):
            duaw('#ffcc00', '变量')
        elif ('列表' in get_input):
            duaw('#ffff66', '列表')
        elif ('数据' in get_input):
            duaw('#ffcc00', '变量')
        elif ('画笔' in get_input):
            duaw('#33cc00', '画笔')
        elif ('侦测' in get_input):
            duaw('#33ff33', '侦测')
        elif ('运算' in get_input):
            duaw('#ffcccc', '运算')
        elif ('物理' in get_input):
            duaw('#990000', '物理')
        else:
            easygui.msgbox('输入有错,重试一遍吧!')
    except :
        break

 


回复

上一页1 页 / 共 0下一页