Skip to content
Snippets Groups Projects
Commit 023fb434 authored by Angy Wallot's avatar Angy Wallot
Browse files

tp.3.1

parent dd7866b1
No related branches found
No related tags found
No related merge requests found
# ANGY WALLOT
# GROUPE 15
# 31/01/2024 (absente)
import turtle
def flocon(l, n):
if n == 0:
turtle.forward(l)
else:
flocon(l / 3, n - 1)
turtle.left(60)
flocon(l / 3, n - 1)
turtle.right(120)
flocon(l / 3, n - 1)
turtle.left(60)
flocon(l / 3, n - 1)
#flocon(500,4)
def triangle(l, n):
if n == 0:
for _ in range(3):
turtle.forward(l)
turtle.left(120)
else:
l /= 2
triangle(l, n - 1)
turtle.forward(l)
triangle(l, n - 1)
turtle.backward(l)
turtle.left(60)
turtle.forward(l)
turtle.right(60)
triangle(l, n - 1)
turtle.left(60)
turtle.backward(l)
turtle.right(60)
triangle(500, 1)
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment