-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
28 lines (24 loc) · 1.38 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
from turtle import Turtle, Screen
import random
tom = Turtle()
Screen().bgcolor("white")
tom.color(random.random(), random.random(), random.random())
direction = [0, 90, 180, 270]
colors = ["red", "green", "blue", "yellow", "orange", "purple", "pink", "white", "gray", "brown", "cyan", "magenta",
"lime", "navy", "maroon", "olive", "silver", "teal", "aqua", "gold", "indigo", "limegreen", "lightblue",
"lightcoral", "lightgreen", "lightpink", "lightsalmon", "lightseagreen", "lightskyblue", "lightsteelblue",
"lightyellow", "mediumaquamarine", "mediumblue", "mediumorchid", "mediumpurple", "mediumseagreen",
"mediumslateblue", "mediumspringgreen", "mediumturquoise", "mediumvioletred", "midnightblue", "navyblue",
"olivedrab", "orangered", "orchid", "palegoldenrod", "palegreen", "paleturquoise", "palevioletred",
"papayawhip", "peachpuff", "peru", "plum", "powderblue", "rosybrown", "royalblue", "saddlebrown", "salmon",
"sandybrown", "seagreen", "seashell", "sienna", "skyblue", "slateblue", "slategray", "snow", "springgreen",
"steelblue", "tan", "thistle", "tomato", "turquoise", "violet", "wheat", "yellowgreen"]
tom.hideturtle()
tom.speed("fastest")
tom.width(3)
for _ in range(1200):
tom.color(random.choice(colors))
tom.forward(25)
tom.setheading(random.choice(direction))
screen = Screen()
screen.exitonclick()