Skip to content

Instantly share code, notes, and snippets.

@shravanasati
Created June 27, 2021 10:16
Show Gist options
  • Save shravanasati/4416f3ee93aa0493a18a335d8c866b0e to your computer and use it in GitHub Desktop.
Save shravanasati/4416f3ee93aa0493a18a335d8c866b0e to your computer and use it in GitHub Desktop.
A python script which creates a 69 using turtle.
import turtle, random
from math import *
t = turtle.Turtle()
turtle.bgcolor("black")
t.speed(3000000)
t.pensize(5)
for i in range(1, 200):
t.color(random.choice(["red", "white", "blue", "green", "yellow", "violet"]))
t.forward(30)
t.left(i)
t.left(sin(i) * cos(i) * tan(i))
t.penup()
t.forward(100)
t.pendown()
for i in range(1, 200):
t.color(random.choice(["red", "white", "blue", "green", "yellow", "violet"]))
t.forward(30)
t.left(sin(i) * cos(i) * tan(i))
t.left(i)
turtle.done()
@yashppawar
Copy link

it is very interesting to see math functions create these spirals, also turtle helps it to be created without any dependencies, also easier to set up. 👍 , thanks @Shravan-1908 for the gist.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment