• If the level is 0, then the turtle moves the given distance in the given direction. Otherwise, the function draws four fractal lines with % of the given distance, angles that produce the given...


Python 3


• If the level is 0, then the turtle moves the given distance in the given direction. Otherwise,<br>the function draws four fractal lines with % of the given distance, angles that produce the<br>given effect, and the given level minus 1.<br>The function drawFractalline is recursive.<br>Write a script that draws the Koch snowflake.<br>Define a function main that will draw a Koch snowflake with the following parameters when<br>the program is run:<br>• Width = 200<br>• Height = 200<br>• Size = 150<br>• Level = 4<br>

Extracted text: • If the level is 0, then the turtle moves the given distance in the given direction. Otherwise, the function draws four fractal lines with % of the given distance, angles that produce the given effect, and the given level minus 1. The function drawFractalline is recursive. Write a script that draws the Koch snowflake. Define a function main that will draw a Koch snowflake with the following parameters when the program is run: • Width = 200 • Height = 200 • Size = 150 • Level = 4
The Koch snowflake is a fractal shape. At level 0, the shape is an equilateral triangle. At level 1,<br>each line segment is split into four equal parts, producing an equilateral bump in the middle of<br>each segment. Figure 7-15 shows these shapes at levels 0, 1, and 2.<br>Python Turtle Graphics<br>Python Turtile Oraphics<br>Python Turtie Graphics<br>or<br>Figure 7-15 First three levels of a Koch snowflake<br>Figure 7-15 First three levels of a Koch snowflake<br>At the top level, the script uses a function drawFractalline to draw three fractal lines. Each<br>line is specified by a given distance, direction (angle), and level:<br>• The initial angles are 0, -120, and 120 degrees.<br>• The initial distance can be any size, such as 200 pixels.<br>• If the level is 0, then the turtle moves the given distance in the given direction. Otherwise,<br>

Extracted text: The Koch snowflake is a fractal shape. At level 0, the shape is an equilateral triangle. At level 1, each line segment is split into four equal parts, producing an equilateral bump in the middle of each segment. Figure 7-15 shows these shapes at levels 0, 1, and 2. Python Turtle Graphics Python Turtile Oraphics Python Turtie Graphics or Figure 7-15 First three levels of a Koch snowflake Figure 7-15 First three levels of a Koch snowflake 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 0, -120, and 120 degrees. • The initial distance can be any size, such as 200 pixels. • If the level is 0, then the turtle moves the given distance in the given direction. Otherwise,

Jun 06, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here