Skip to content

Instantly share code, notes, and snippets.

@yigitbey
Created October 9, 2013 22:04
Show Gist options
  • Save yigitbey/6909274 to your computer and use it in GitHub Desktop.
Save yigitbey/6909274 to your computer and use it in GitHub Desktop.
from turtle import *
from itertools import count
def snowflake(length, line=forward, *rest):
length=length*2
line(length/3, *rest)
right(60)
line(length/3, *rest)
left(120)
line(length/3, *rest)
right(60)
line(length/3, *rest)
left(120)
screensize(2000,1500)
speed(0)
setpos(-400,000)
for c in count(0):
tracer(abs(2-c))
width(c)
if abs(xcor()) >= 500:
left(90)
if abs(ycor()) >= 250:
left(90)
snowflake(120,*[snowflake for i in range(c)])
right(90)
clear()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment