Scratch Lab 2
Name: Zak "The Legend" Singh
Assignment:Scratch Lab #2
In this lab we animated our name, tested out embedded loops, and tried out loops and conditional commands.
I animated my name using the "next costume" block. For the embedded loops, I found that the first two loops worked. For the loop and conditional commands, I learned that the forever loop worked best.
- Problem #3
- The first one will because 10 x 10 = 100. The second one also works because it is 10 x 10 x 1, which equals 100.
- Problem #5
- The forever loop works best because then whenever you touch it with your mouse it works, since it is always waiting to be touched.
- What are the types of loops contained in Scratch? What are the differences?
- Forever, repeat, and repeat until. The forever loop keeps going forever. The repeat loop repeats it a set number of times.
- 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 structure would wrk best because then you could end it whenever you need it to without having to try and time it.
- Does the following loop structure work? Does it make sense? Why or why not?
- No because once it says "Forever loop!" once it will get stuck in the second loop forever.
- How can sprites “know” when to begin an action? Is there more than one way?
- They can know via either another sprite's broadcast or an if command.
- Are the following code snippets equivalent? Why or why not?
- Yes, because they are the same thing, just reversed. The if command in the first is waiting for the space key to be pressed, while the second waits for the space key to not be pressed.