Skip to content

Instantly share code, notes, and snippets.

@amandaroos
Created April 17, 2020 00:22
Show Gist options
  • Save amandaroos/7c79d4500b98658ba4e62e70d0486eba to your computer and use it in GitHub Desktop.
Save amandaroos/7c79d4500b98658ba4e62e70d0486eba to your computer and use it in GitHub Desktop.
import turtle
import tkinter as tk
from tkinter import ttk
window = turtle.Screen()
def runTurtles():
window = turtle.Screen()
t1 = turtle.Turtle()
t2 = turtle.Turtle()
t3 = turtle.Turtle()
t4 = turtle.Turtle()
t5 = turtle.Turtle()
t6 = turtle.Turtle()
t7 = turtle.Turtle()
t8 = turtle.Turtle()
t9 = turtle.Turtle()
t10 = turtle.Turtle()
t11 = turtle.Turtle()
t12 = turtle.Turtle()
turtles = [t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12]
colors = ["purple", "magenta", "red", "#ff4500", "orange", "#FFBF00", "yellow", "green","teal", "aqua","blue", "indigo", ]
reversedColors = colors[::-1]
speed = 1
fast = 1000
width = 8
i = 0
j = 570
for t in turtles:
t.shape("square")
t.speed(fast)
t.width(width)
t.color(colors[i])
i = i + 1
t.left(j)
j = j - 30
forward = 80
turn = 120
for i in range (0,3):
for t in turtles:
t.speed(speed)
t.forward(forward)
#for t in turtles:
t.speed(fast)
t.left(turn)
for t in turtles:
t.speed(speed)
t.forward(forward)
popup = tk.Tk()
B1 = ttk.Button(popup, text="Start", command = runTurtles)
B1.pack()
popup.mainloop()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment