Lab Write Up 2
Name: Cameron Beattie
Assignment: Lab #2
These labs focused on loops and communication between sprites
- What are the types of loops contained in Scratch? What are the differences?
- There are loops that loop for a set amount of times, forever loops that loop forever, and loops that loop until a certain action is perforemed.
- 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?
- The repeat until loop, because you can tell it to repeat until whatever action is performed that you want it to stop during.
- Does the following loop structure work? Does it make sense? Why or why not?
- No it does not work because the loop would get stuck on the forever loop that is inside the other forever loop so it would never say "Forever loop!" again.
- How can sprites “know” when to begin an action? Is there more than one way?
- By using event commands. There are several commands like clicking the flag, pressing the space bar, clicking, and recieving a message from another sprite.
- Are the following code snippets equivalent? Why or why not?
- Yes they are equivalent, they perform the same action, the code just runs in a different order. There is no visible difference.