Commit 8aa39e0f by BellCodeEditor

save project

parent bc21d248
Showing with 56 additions and 7 deletions
import turtle import turtle
screen=turtle.Screen() screen=turtle.Screen()
screen.bgcolor("pink") screen.bgcolor("light blue")
#背景颜色 #背景颜色
pen=turtle.Pen() pen=turtle.Pen()
pen.penup() pen.penup()
...@@ -8,15 +8,17 @@ pen.goto(100,-100) ...@@ -8,15 +8,17 @@ pen.goto(100,-100)
pen.write("你\n好",font=("Times",20,"normal")) pen.write("你\n好",font=("Times",20,"normal"))
pen.hideturtle() pen.hideturtle()
# 写字 # 写字
len=screen.textinput("提示","你想要多大的爱心")
lovesize=int(len)
pen1=turtle.Pen() pen1=turtle.Pen()
pen1.pencolor("red") pen1.pencolor("red")
pen1.pensize(5) pen1.pensize(5)
pen1.left(45) pen1.left(45)
pen1.forward(100) pen1.forward(2*lovesize)
pen1.circle(50,180) pen1.circle(lovesize,180)
pen1.right(90) pen1.right(90)
pen1.circle(50,180) pen1.circle(lovesize,180)
pen1.forward(100) pen1.forward(2*lovesize)
pen1.hideturtle() pen1.hideturtle()
turtle.done() turtle.done()
#画爱心 #画爱心
\ No newline at end of file
import turtle
pen=turtle.Pen()
screen=turtle.Screen()
len=screen.textinput("提示","你想要边长多少的正方形")
lovesize=int(len)
for i in range(4):
pen.forward(lovesize)
pen.right(90)
pen.hideturtle()
turtle.done()
import turtle
pen=turtle.Pen()
screen=turtle.Screen()
len=screen.textinput("提示","你想要多大的魔法阵")
a=int(len)
pen.circle(a)
pen.circle(a,360,3)
pen.circle(a,60)
pen.circle(a,360,3)
pen.hideturtle()
turtle.done()
import turtle
screen=turtle.Screen()
pen=turtle.Pen()
pen.pencolor("red")
pen.pensize(5)
len=screen.textinput("提示","你想要多大的小人")
e=int(len)
pen.circle(e,360)
pen.right(90)
pen.forward(e)
pen.right(45)
pen.forward(2*e)
pen.forward(-2*e)
pen.left(90)
pen.forward(2*e)
pen.forward(-2*e)
pen.right(45)
pen.forward(1.5*e)
pen.right(35)
pen.forward(2*e)
pen.forward(-2*e)
pen.left(75)
pen.forward(2*e)
pen.forward(-2*e)
pen.hideturtle()
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