Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Your Tasks The Koch snowflake is a fractal shape. At level 0 , the shape is an equilateral triangle. At level 1 , each line
Your Tasks
The Koch snowflake is a fractal shape. At level the shape is an equilateral triangle. At level each line segment is split into four equal
parts, producing an equilateral bump in the middle of each segment. Figure shows these shapes at levels and LO:
At the top level, the script uses a function drawFractalLine to draw three fractal lines. Each line is specified by a given distance, direction
angle and level. The initial angles are and degrees. The initial distance can be any size, such as pixels. The function
drawFractalLine is recursive. If the level is then the turtle moves the given distance in the given direction. Otherwise, the function
draws four fractal lines with onethird of the given distance, angles that produce the given effect, and the given level minus Write a script
in the file
koch.py that draws the Koch snowflake.
Instructions
PS: I tried using AI and it wasn't helpful at all so incase you want to use AI just know this
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started