Skip to content

Instantly share code, notes, and snippets.

@pinglunliao
Created February 4, 2019 02:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pinglunliao/cf2078b9d8d7ff26b0e2069c78a9383a to your computer and use it in GitHub Desktop.
Save pinglunliao/cf2078b9d8d7ff26b0e2069c78a9383a to your computer and use it in GitHub Desktop.
from turtle import *
import random
import time
def change_color(t):
R = random.random()
B = random.random()
G = random.random()
t.pencolor(R, G, B)
def display_msg(msg):
for c in msg:
change_color(t)
t.write(c, move=False, align="left", font=("Arial", 36, "normal"))
t.forward(50)
width = 800
height = 200
xPos = -(width/2)
yPos = 0
setup(width, height)
t = Turtle("turtle")
t.speed(0)
t.hideturtle()
t.begin_fill()
#t._delay(25)
t.penup()
while True:
t.goto(xPos + 10, yPos)
display_msg("祝各位新年快樂,豬事順利!!!")
t.goto(xPos + 10, yPos - 60)
display_msg("2019/2/4 廖柄㷍")
time.sleep(2)
t.clear()
t.end_fill()
done()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment