moving files

This commit is contained in:
Debucquoy
2023-02-15 13:40:50 +01:00
parent 93ae5a67d2
commit 2109fa74c0
81 changed files with 126 additions and 0 deletions

28
q1/04oct/ex5.py Normal file
View File

@ -0,0 +1,28 @@
from uturtle import (
umonsTurtle, wait,
moveForward, moveBackward,
turnLeft, turnRight,
dropPen, usePen)
def carre(t: umonsTurtle, x: int, seuil: int):
"""draw an alternative to koch witch is based on squares"""
if x < seuil:
moveForward(t, x)
return
carre(t, x/3, seuil)
turnLeft(t)
carre(t, x/3, seuil)
turnRight(t)
carre(t, x/3, seuil)
turnRight(t)
carre(t, x/3, seuil)
turnLeft(t)
carre(t, x/3, seuil)
if __name__ == "__main__":
turtle = umonsTurtle()
turtle.speed(0)
carre(turtle, 200, 5)
wait()