TURTLE ART GALLERY & MEMO π’
In this program, I used Random block a lot. Since the random block can generate different values each time you call it, I can create unique artwork each time I run the coding block. There are several elements that I used random block:
1. Color
2. Width and Length
3. Positions
4. Pen size
πππ
I reckon this challenge is a difficult one for me. I spent a long time dong this one than others. As presented in the picture, the code block is a large chunk with four conditional statements. In order to make the main body of the code look more compact and clean, I used my block to store a repeated pattern.
1.Before the conditional statements, the pen size, pen color,
the start position were set.
2.By analyzing the picture, I found the color changes
according to the angle.
3.The movement of the turtle is the same:forward,
then back
4.Angle needs to be changed a little every time the
turtle repeats the movement.
π Reflection on IF + FOREVER
In the beginning, I just knew how to use if statement and forever statement separately and once. When I came across the challenge I posted above, I was confused about how to loop the movement pattern and restrict the condition to be a certain range of angle, and how to apply the changes of color to the drawing. To solve the first problem, I tried to combine if and forever together, to make sure that the angle changes every loop. To solve the second one, I realized the key was the different conditions, and consequently nested conditional statements one inside another.
Comments
Post a Comment