Commit fc080e7f by BellCodeEditor

save project

parent 2060991c
Showing with 74 additions and 76 deletions
# 利用write()帮助悟空给诺依回信吧~
import turtle
("大小")
int(love)
#创建背景 设置颜色
screen=turtle.Screen()
screen.bgcolor("light blue")
len=screen.textinput("100","100")
len=int(len)
pen=turtle.Pen()
pen.write("你好\诺伊.",font=("Times",30,"normal"))
#写字
pen =turtle.Pen()
pen.write("你好\n诺伊",font=("宋体",30))
pen.hideturtle()
len=60
pen.penup()
pen.goto(100,100)
pen.pendown()
pen.pensize(5)
pen.pencolor("red")
pen.left(45)
pen.forward(2*len)
pen.circle(len,180)
pen.right(90)
pen.circle(len,180)
pen.forward(2*len)
turtle.done()
#画
pen1=turtle.Pen()
pen1.pencolor("red")
pen1.pensize(5)
pen1.left(45)
pen1.forward(love*2)
pen1.circle(love,180)
pen1.right(90)
pen1.circle(love,180)
pen1.forward(love*2)
pen1.hideturtle()
turtle.done()
\ No newline at end of file
......@@ -15,64 +15,61 @@ def triangle(a,b,c):
t.left(120)
t.end_fill()
def square(a,b,c,d):
t.penup()f
t.goto(a,b)f
t.pendown()f
t.fillcolor("#cec2d6")f
t.begin_fill()f
t.forward(c)f
t.left(90)f
t.forward(d)f
t.left(90)f
t.forward(c)f
t.left(90)f
t.forward(d)f
t.left(90)f
t.end_fill()f
def wall(a,b,c,d):f
#a,b为坐标;c为底部宽,d为长f
t.penup()f
t.goto(a,b)f
t.pendown()f
t.fillcolor("#cec2d6")f
t.begin_fill()f
t.forward(c)f
t.left(90)f
t.forward(d)f
for i in range(0,4,1):f
t.left(90)f
t.forward(10)f
t.left(90)f
t.forward(10)f
t.right(90)f
t.forward(10)f
t.right(90)f
t.forward(10)f
t.left(90)f
t.forward(10)f
t.left(90)f
t.forward(d)f
t.left(90)f
t.end_fill()f
def downwall(a,b,c,d):f
#a,b为坐标;c为底部宽,d为长f
t.penup()f
t.goto(a,b)f
t.pendown()f
t.fillcolor("#cec2d6")f
t.begin_fill()f
t.forward(c)f
t.left(90)f
t.forward(d)f
for i in range(0,5,1):f
t.left(90)f
t.forward(10)f
t.left(90)f
t.forward(10)f
t.right(90)f
t.forward(10)f
t.right(90)f
t.forward(10)f
t.penup()
t.goto(a,b)
t.pendown()
t.fillcolor("#cec2d6")
t.begin_fill()
t.forward(c)
t.left(90)
t.forward(d)
t.forward(c)
t.left(90)
t.forward(d)
t.left(90)
t.end_fill()
def wall(a,b,c,d):
#a,b为坐标;c为底部宽,d为长
t.penup()
t.goto(a,b)
t.pendown()
t.fillcolor("#cec2d6")
t.begin_fill()
t.forward(c)
t.left(90)
t.forward(d)
for i in range(0,4,1):
t.left(90)
t.forward(10)
t.left(90)
t.forward(10)
t.right(90)
t.forward(10
t.right(90)
t.forward(10)
t.left(90)
t.forward(10)
t.left(90)
t.forward(d)
t.left(90)
t.end_fill()
def downwall(a,b,c,d):
#a,b为坐标;c为底部宽,d为长
t.penup()
t.goto(a,b)
t.pendown()
t.fillcolor("#cec2d6")
t.begin_fill()
t.forward(c)
t.left(90)
t.forward(d)
t.forward(10)
t.left(90)
t.forward(10)
t.right(90)
t.forward(10)
t.right(90)
t.forward(10)
t.left(90)f
t.forward(10)f
t.left(90)f
......
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