Scratch Lab #2

Click Here for Problem #1

Click Here for Problem #2

Click Here for Problem #3

Scratch Lab #2 Write Up

Question #1

The types of loops are: repeat (x) times, repeat forever, and repeat until (event). The repeat a certain amount of times loop will only repeat that many times, the repeat forever will obviously never stop until told to, and the final repeat until (event) loop with go on forever until the specified action is done and then it will stop.

Question #2

The best structure to use when you dont know how long it should repeat for is the repeat until (event) loop, because it will go on and on until it does or reaches whatever event you wish for it to stop after.

Question #3

The shown loop structure does work, however it doesn't make any sense because since there is a forever loop within a forever loop, the internal forever loop will go on forever without ever making it back to the top of the first forever loop.

Question #4

Sprites "know" what to do by using the brown event blocks that have different ways to have sprites initiate their codes. There are seven different command blocks to use to let sprites "know" to begin, such as broadcasting messages to each other, clicking the flag button, when the sprite is clicked or even when loudness or another quantity reaches a certain number.

Question #5

The shown code snippets are equivalent. They are equivalent because although the "if" and "else" conditionals seem inverted, the conditional trigger has also been inverted, so it works out to be the same statement.

Click HERE to return to homepage.