Scratch Lab 2

What are the types of loops contained in Scratch? What are the differences?

There are forever loops and repeat loops. The forever loops never stops and the repeat loop stops after x amount 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 "if, then" loop.

Does the following loop structure work? Does it make sense? Why or why not?

It works but it doesn't make sense to use the forever loop when the sprite says "forever loop" because it will never show up again.

How can sprites “know” when to begin an action? Is there more than one way?

The sprite can know when to begin an action when that action is put in an event. There are many different ways to start and event like pressing the space bar or clicking the green flag.

Are the following code snippets equivalent? Why or why not?

No because in the first code the sprite only changes costume if the spacebar is pressed. In the second code the sprite changes costumes if the spacebar is not pressed.

Click HERE to return to homepage.