Commit c3862812 by BellCodeEditor

save project

parent ad89a433
Showing with 11 additions and 29 deletions
import turtle#导入turtle模块
#设置画布
screen=turtle.Screen()#创建背景
screen.bgcolor("light blue")#设置背景颜色
aa=screen.textinput("对话框""你想要多大的爱心?")
#写字
pen=turtle.Pen()#创建画笔
pen.penup()#起笔
pen.goto(100,-100)#画笔落到坐标(100,-100)处
pen.write("你好,\n老六",font=("times",20,"normal"))#设置写的字
pen.hideturtle()#隐藏画笔
#画爱心
import random#导入随机模块
len=int(aa)
pen1=turtle.Pen()#创建画笔
pen1.pensize(5)#设置画笔大小
pen1.pencolor("pink")#设置画笔颜色
pen1.fillcolor("pink")#设置填充颜色
pen1.begin_fill()#开始填充
pen1.left(45)#左转45度
pen1.forward(len*2)#将随机数作为参数
pen1.circle(len,180)#将随机数作为参数
pen1.right(90)#右转45度
pen1.circle(len,180)#将随机数作为参数
pen1.forward(len*2)#将随机数作为参数
pen1.end_fill()#填充结束
pen1.hideturtle()#隐藏画笔
turtle.done()#保存画布
\ No newline at end of file
import turtle
pen=turtle.Pen()
screen=turtle.Screen()
size=screen.textinput("提示","你想要多大的魔法阵呀?")
len=int(size)
pen.circle(len)
pen.circle(len,360,3)
pen.circle(len,60)
pen.circle(len,360,3)
turtle.done()
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment