Created
March 16, 2022 15:59
-
-
Save supcik/75fc6fbe8124d27ff9cbbd6b2cb588fc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
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