Commit a42cb467 by BellCodeEditor

auto save

parent b1faef5e
Showing with 59 additions and 1 deletions
import turtle
import random
pen=turtle.Pen()
turtle.screensize(800,600)
turtle.Screen().bgcolor("#ffffff")
def getColor():
color: int
r = random.randint(16, 255)
g = random.randint(16, 255)
b = random.randint(16, 255)
r = hex(r)
g = hex(g)
b = hex(b)
rgb = "#" + r[2:] + g[2:] + b[2:]
return rgb
def heart():
color=getColor()
pen.fillcolor(color)
pen.begin_fill()
pen.left(45)
pen.forward(20)
pen.circle(10,180)
pen.right(90)
pen.circle(10,180)
pen.forward(20)
pen.end_fill()
def pengo():
x=random.randint(-400,400)
y=random.randint(-300,300)
pen.penup()
pen.goto(x,y)
pen.pendown()
def start():
pen.write("不会上课陈十一",font=("华文行楷",42,"normal"))
pen.speed(0)
def end():
pen.hideturtle()
turtle.done()
def heart300():
for i in range(300):
heart()
pengo()
def fengche():
n=random.randint(300,500)
pen.goto(0,0)
pen.pendown()
for i in range(1,n):
pen.forward(i)
pen.pencolor(getColor())
pen.right(91)
start()
fengche()
heart300()
end()
\ No newline at end of file
......@@ -3,7 +3,7 @@ import turtle
screen=turtle.Screen()
screen.bgcolor("light blue")
pen=turtle.Pen()
pen.write("你好/nfuck.",font=("Times",30,"normal"))
pen.write("你好\n\t行了.",font=("华文行楷",30,"normal"))
pen.hideturtle()
pen.penup()
......
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