Commit 636c314d by BellCodeEditor

auto save

parent f9b6bca9
Showing with 131 additions and 8 deletions
# 悟空想画个六芒星魔法阵,主要的代码已写出,但这有bug,请你帮忙调试下~
import turtle
pen= turtle.Pen()
size=textinput("提示","你想要多大的魔法阵呀?")
pen.circle(size)
pen.circle(size,360,3)
pen.circle(size,60)
pen.circle(size,360,3)
turtle.done()
screen = turtle.Screen()
screen.bgcolor("light blue")
pen = turtle.Pen()
pen.color("red")
pen.pensize(5)
# 画爱心
def love(len):
pen.left(45)
pen.forward(2*len)
pen.circle(len,180)
pen.right(90)
pen.circle(len,180)
pen.forward(2*len)
size = float(turtle.textinput("提示2","你想画多大的爱心呢?"))
pen.fillcolor("red")
pen.begin_fill()
love(size)
pen.end_fill()
pen.hideturtle()
# 写文字
pen1 = turtle.Pen()
pen1.pencolor("purple")
pen1.penup()
pen1.goto(-100,-100)
text = turtle.textinput("提示2","你想写点什么?")
pen1.write(text,font=("Times",18,"normal"))
pen1.hideturtle()
turtle.done()
\ No newline at end of file
import turtle
import time
# import time
t = turtle.Turtle()
t.speed(30)
# 设置初始位置
t.penup()
t.left(90)
t.fd(200)
t.pendown()
t.right(90)
# 花蕊
t.fillcolor("red")
t.begin_fill()
t.circle(10, 180)
t.circle(25, 110)
t.left(50)
t.circle(60, 45)
t.circle(20, 170)
t.right(24)
t.fd(30)
t.left(10)
t.circle(30, 110)
t.fd(20)
t.left(40)
t.circle(90, 70)
t.circle(30, 150)
t.right(30)
t.fd(15)
t.circle(80, 90)
t.left(15)
t.fd(45)
t.right(165)
t.fd(20)
t.left(155)
t.circle(150, 80)
t.left(50)
t.circle(150, 90)
t.end_fill()
# 花瓣1
t.left(150)
t.circle(-90, 70)
t.left(20)
t.circle(75, 105)
t.setheading(60)
t.circle(80, 98)
t.circle(-90, 40)
# 花瓣2
t.left(180)
t.circle(90, 40)
t.circle(-80, 98)
t.setheading(-83)
# 叶子1
t.fd(30)
t.left(90)
t.fd(25)
t.left(45)
t.fillcolor("green")
t.begin_fill()
t.circle(-80, 90)
t.right(90)
t.circle(-80, 90)
t.end_fill()
t.right(135)
t.fd(60)
t.left(180)
t.fd(85)
t.left(90)
t.fd(80)
# 叶子2
t.right(90)
t.right(45)
t.fillcolor("green")
t.begin_fill()
t.circle(80, 90)
t.left(90)
t.circle(80, 90)
t.end_fill()
t.left(135)
t.fd(60)
t.left(180)
t.fd(60)
t.right(90)
t.circle(200, 60)
time.sleep(5)
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