Skip to content

Instantly share code, notes, and snippets.

@supcik
Created March 16, 2022 15:59
Show Gist options
  • Save supcik/75fc6fbe8124d27ff9cbbd6b2cb588fc to your computer and use it in GitHub Desktop.
Save supcik/75fc6fbe8124d27ff9cbbd6b2cb588fc to your computer and use it in GitHub Desktop.
"""
Programme Python pour dessiner un flocon
Portes ouvertes de la Haute école d'ingénierie
et d'architecture de Fribourg
"""
import turtle
t = turtle.Turtle()
t.color("blue")
t.speed(0)
def line(l, n):
if n > 0:
line(l/3, n-1)
t.right(60)
line(l/3, n-1)
t.left(120)
line(l/3, n-1)
t.right(60)
line(l/3, n-1)
else:
t.forward(l)
def snowFlake(size, depth):
for _ in range(3):
line(size, depth)
t.left(120)
snowFlake(400,3)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment