Skip to content

Instantly share code, notes, and snippets.

@stephengruppetta
Created December 18, 2023 11:09
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 stephengruppetta/c5ac59d05d58aa05897f9152cd667f6c to your computer and use it in GitHub Desktop.
Save stephengruppetta/c5ac59d05d58aa05897f9152cd667f6c to your computer and use it in GitHub Desktop.
# Do not try this at home…
import turtle
import random
# Starts off fairly "normal"…
n_turtles = 100
window = turtle.Screen()
window.tracer(0)
window.setup(700, 700)
window.bgcolor(0.2, 0.2, 0.2)
# Create and customise the turtles
cute_turtles = [
(
cute_turtle := turtle.Turtle(),
cute_turtle.left(idx * (360 / n_turtles)),
cute_turtle.color(
random.random(),
random.random(),
random.random(),
),
cute_turtle.penup(),
cute_turtle.shape("turtle"),
)
for idx in range(n_turtles)
]
window.update()
turtle.done()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment