Commit 9d638388 by BellCodeEditor

auto save

parent a84a150f
Showing with 402 additions and 0 deletions
import random
import turtle
screen=turtle.Screen()
screen.bgcolor("light blue")
pen=turtle.Pen()
n=100
pen.penup()
pen.goto(100,-100)
import time
time.sleep(1)
pen.write("老婆:\n有你的地方就是幸福!\n有你的相伴是我一生的幸运!\n有你的爱我上辈子一定是拯救了整个地球!\n七夕节快乐!\n爱你的老公", font=("times",15,"normal"))
pen.goto(-350,-100)
pen.write("I love you" , font=("times",60,"normal"))
time.sleep(2)
pen1=turtle.Pen()
pen1.speed(n/10)
pen1.fillcolor("red")
pen1.begin_fill()
pen1.pensize(10)
pen1.pencolor("red")
len=100
pen1.left(45)
pen1.forward(2*len)
pen1.circle(len,180)
pen1.right(90)
pen1.circle(len,180)
pen1.forward(2*len)
pen1.penup()
pen1.goto(-200,0)
pen1.pendown()
pen1.left(90)
pen1.forward(2*len)
pen1.circle(len,180)
pen1.right(90)
pen1.circle(len,180)
pen1.forward(2*len)
pen1.end_fill()
pen1.penup()
pen1.goto(-500,100)
pen1.pendown()
pen1.left(60)
pen1.forward(800)
pen1.right(90)
pen1.forward(0.5*len)
pen1.left(120)
pen1.forward(len)
pen1.left(120)
pen1.forward(len)
pen1.left(120)
pen1.forward(0.5*len)
pen2=turtle.Pen()
pen2.penup()
pen2.goto(-400,-400)
pen2.pendown()
import turtle
import random
import time
import threading
turtle.colormode(255)
t1 = turtle.Turtle()
t2 = turtle.Turtle()
t3 = turtle.Turtle()
t4 = turtle.Turtle()
t5 = turtle.Turtle()
t6 = turtle.Turtle()
t7 = turtle.Turtle()
t8 = turtle.Turtle()
t1.hideturtle()
t1.pensize(0)
t1.pencolor(255,255,255)
t2.hideturtle()
t2.pensize(0)
t2.pencolor(255,255,255)
t3.hideturtle()
t3.pensize(0)
t3.pencolor(255,255,255)
t4.hideturtle()
t4.pensize(0)
t4.pencolor(255,255,255)
t5.hideturtle()
t5.pensize(0)
t5.pencolor(255,255,255)
t6.hideturtle()
t6.pensize(0)
t6.pencolor(255,255,255)
t7.hideturtle()
t7.pensize(0)
t7.pencolor(255,255,255)
t8.hideturtle()
t8.pensize(0)
t8.pencolor(255,255,255)
def wait():
time.sleep(0.5)
def move1():
# turtle.tracer(False)
t1.penup()
t1.goto(400,400)
t1.pendown()
while True:
t1.speed(n)
t1.fillcolor(random.randint(0, 255), random.randint(0, 255), random.randint(0, 255))
t1.begin_fill()
for i in range(20):
t1.forward(40)
t1.right(162)
# for i in range(500):
# print("")
# turtle.reset()
wait()
t1.end_fill()
def move2():
t2.penup()
t2.goto(100,-200)
t2.pendown()
# turtle.tracer(False)
while True:
t2.speed(n)
t2.fillcolor(random.randint(0, 255), random.randint(0, 255), random.randint(0, 255))
t2.begin_fill()
for i in range(20):
t2.forward(40)
t2.right(162)
# for i in range(500):
# print("")
# turtle.reset()
wait()
t2.end_fill()
def move3():
# turtle.tracer(False)
t3.penup()
t3.goto(-300,400)
t3.pendown()
while True:
t3.speed(n)
t3.fillcolor(random.randint(0, 255), random.randint(0, 255), random.randint(0, 255))
t3.begin_fill()
for i in range(20):
t3.forward(60)
t3.right(162)
# for i in range(500):
# print("")
# turtle.reset()
wait()
t3.end_fill()
def move4():
t4.penup()
t4.goto(300,-400)
t4.pendown()
# turtle.tracer(False)
while True:
t4.speed(n)
t4.fillcolor(random.randint(0, 255), random.randint(0, 255), random.randint(0, 255))
t4.begin_fill()
for i in range(20):
t4.forward(40)
t4.right(162)
# for i in range(500):
# print("")
# turtle.reset()
wait()
t4.end_fill()
def move5():
# turtle.tracer(False)
t5.penup()
t5.goto(-460,200)
t5.pendown()
while True:
t5.speed(n)
t5.fillcolor(random.randint(0, 255), random.randint(0, 255), random.randint(0, 255))
t5.begin_fill()
for i in range(5):
t5.forward(50)
t5.right(144)
# for i in range(500):
# print("")
# turtle.reset()
wait()
t5.end_fill()
def move6():
t6.penup()
t6.goto(400,-200)
t6.pendown()
# turtle.tracer(False)
while True:
t6.speed(n)
t6.fillcolor(random.randint(0, 255), random.randint(0, 255), random.randint(0, 255))
t6.begin_fill()
for i in range(20):
t6.forward(40)
t6.right(162)
# for i in range(500):
# print("")
# turtle.reset()
wait()
t6.end_fill()
def move7():
# turtle.tracer(False)
t7.penup()
t7.goto(300,200)
t7.pendown()
while True:
t7.speed(n)
t7.fillcolor(random.randint(0, 255), random.randint(0, 255), random.randint(0, 255))
t7.begin_fill()
for i in range(20):
t7.forward(60)
t7.right(162)
# for i in range(500):
# print("")
# turtle.reset()
wait()
t7.end_fill()
def move8():
t8.penup()
t8.goto(-500,-200)
t8.pendown()
# turtle.tracer(False)
while True:
t8.speed(n)
t8.fillcolor(random.randint(0, 255), random.randint(0, 255), random.randint(0, 255))
t8.begin_fill()
for i in range(5):
t8.forward(40)
t8.right(144)
# for i in range(500):
# print("")
# turtle.reset()
wait()
t8.end_fill()
# for i in range(5):
# move()
# time.sleep(1000)
# move1()
# move2()
thread1 = threading.Thread(target=move1)
thread2 = threading.Thread(target=move2)
thread3 = threading.Thread(target=move3)
thread4 = threading.Thread(target=move4)
thread5 = threading.Thread(target=move5)
thread6 = threading.Thread(target=move6)
thread7 = threading.Thread(target=move7)
thread8 = threading.Thread(target=move8)
thread1.start()
thread2.start()
thread3.start()
thread4.start()
thread5.start()
thread6.start()
thread7.start()
thread8.start()
turtle.mainloop()
# pen2.speed(200)
# pen2.pencolor("white")
# for i in range(20):
# pen2.forward(80)
# pen2.left(162)
# pen2.penup()
# pen2.goto(400,-200)
# pen2.pendown()
# pen2.pencolor("red")
# for i in range(20):
# pen2.forward(40)
# pen2.left(162)
# pen2.penup()
# pen2.goto(200,400)
# pen2.pendown()
# pen2.pencolor("blue")
# for i in range(20):
# pen2.forward(40)
# pen2.left(162)
# pen2.penup()
# pen2.goto(-300,400)
# pen2.pendown()
# pen2.pencolor("white")
# for i in range(20):
# pen2.forward(40)
# pen2.left(162)
# pen2.penup()
# pen2.goto(-200,-100)
# pen2.pendown()
# pen2.pencolor("red")
# for i in range(20):
# pen2.forward(60)
# pen2.left(162)
# pen1.hideturtle()
# turtle.done()
\ No newline at end of file
import turtle
import random
import time
import threading
turtle.colormode(255)
t1 = turtle.Turtle()
t2 = turtle.Turtle()
t1.hideturtle()
t1.pensize(0)
t1.pencolor(255,255,255)
t2.hideturtle()
t2.pensize(0)
t2.pencolor(255,255,255)
def wait():
time.sleep(0.5)
def move1():
# turtle.tracer(False)
while True:
t1.speed(0)
t1.fillcolor(random.randint(0, 255), random.randint(0, 255), random.randint(0, 255))
t1.begin_fill()
for i in range(5):
t1.forward(100)
t1.right(144)
# for i in range(500):
# print("")
# turtle.reset()
wait()
t1.end_fill()
def move2():
t2.goto(100,100)
# turtle.tracer(False)
for i in range(5):
t2.speed(0)
t2.fillcolor(random.randint(0, 255), random.randint(0, 255), random.randint(0, 255))
t2.begin_fill()
for i in range(5):
t2.forward(100)
t2.right(144)
# for i in range(500):
# print("")
# turtle.reset()
wait()
t2.end_fill()
# for i in range(5):
# move()
# time.sleep(1000)
# move1()
# move2()
thread1 = threading.Thread(target=move1)
thread2 = threading.Thread(target=move2)
thread1.start()
thread2.start()
turtle.mainloop()
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