Commit fc080e7f by BellCodeEditor

save project

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