Created
February 4, 2019 02:44
-
-
Save pinglunliao/cf2078b9d8d7ff26b0e2069c78a9383a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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