Name: Kelly Yokoi
Period: 7
Assignment: Lab #2
Scratch Lab #2 focused on loops and repetition in scratch. Problem #1 started out basic with the creation of my own sprite that contains my name and has multiple costumes. I revisited the drawing of polygons in Problem #2. Using loops I had to create a hexagon and a circle. Problem #3 had me analyze embedded loops.
I first drew my sprite and wrote my name then I made multiple costumes and had the hand of the stick figure move a bit each time. I then had the sprite switch costumes every 0.2 seconds to look like it was waving.
For this problem I had the sprite first draw a circle by putting the pen down and using the repeat function to have the sprite move 10 steps and spin 15 degrees 24 times. I then lifted the pen and had the sprite move to where I wanted the hexagon. To draw the hexagon I put the pen down and had the sprite repeat the move of 2 steps so it would draw the hexagon slowly. That repetition was then put in a repetition of 6 along with 60 degree turning. This created my desired hexagon.
For problem #3 I just copied the scripts in the picture and put them on different sprites so I could compare them. One sprite would repeat 10 times a move of 10 steps. Another sprite would repeat 10 times the move of 1 step 10 times. For the third sprite the move of 5 steps was repeated 16 times and then that all was repeated 20 times along with a move of 1 step. The fourth step was a repeat of 1 step 20 times then a repeat of 5 steps 16 times. The 5th sprite was a forever loop repeating 10 steps 10 times.The Sprite that moved 100 steps was the first sprite.
What are the types of loops contained in Scratch? What are the differences?
If you are given a situation where you want an action to repeat, but you don't know how long it should repeat for, which loop is the best structure to use? Why?
Does the following loop structure work? Does it make sense? Why or why not?
How can sprites "know" when to begin an action? Is there more than one way?
Are the following code snippets equivalent? Why or why not?