diff --git a/__pycache__/turtle.cpython-314.pyc b/__pycache__/turtle.cpython-314.pyc new file mode 100644 index 0000000..bf9fc9c Binary files /dev/null and b/__pycache__/turtle.cpython-314.pyc differ diff --git a/theturdle.py b/theturdle.py new file mode 100644 index 0000000..a7c0707 --- /dev/null +++ b/theturdle.py @@ -0,0 +1,41 @@ +import turtle + +t = turtle.Turtle() +# def hexagon(n): +# for i in range(n): +# turtle.right(120) +# turtle.forward(200) +# hexagon(6) + +# def stair(n): +# if n <= 0: +# return +# turtle.forward(20) +# turtle.left(90) +# turtle.forward(20) +# turtle.right(90) + +# stair(n - 1) + +# turtle.speed(10) +# stair(100) +# turtle.done() +t.left(90) +def baum(length, n): + if n <= 0: + return + + t.forward(length) + t.right(45) + t.forward(length // 1.1) + t.right(180) + t.forward(length // 1.1) + t.right(90) + t.forward(length // 1.1) + + return n * baum(n - 1) + + + +baum(50, 10) +turtle.done() diff --git a/turtle.py b/turtle.py deleted file mode 100644 index 7c27b6d..0000000 --- a/turtle.py +++ /dev/null @@ -1,8 +0,0 @@ -import turtle -turtle.forward(200) - -turtle.right(90) - -turtle.forward(200) - -turtle.mainloop() \ No newline at end of file