Scratch Lab #2

Pair Programming


Click Here for Link

Problem #1 - Name Animation


Click Here for Link

For this problem I created a sprite which incorporated my name, if you click on the green flag, the spirte will move, with the name.

Problem #2 - Polygons Revisted


Click Here for Link

This lab demonstrates a more efficient way to make the sprite draw a hexagon and a circle using loops.

Problem #3 - Embedded Loop


Click Here for Link

This problem demonstrates the power and extent of loops. Only the ballerina, the cat and the butterfly are moving exactly 100 steps, while the rest of the embedded loops are making the sprites move much more. The butterfly moves 1 step, 20 times and then 5 steps, 16 times which adds up to 100. The ballerina moves 10 steps, 10 times and the cat moves 1 step, 10 times in another 10 time loop, also adding up to 100. Loops can be very powerful and must be used carefully and thoughfully.

Problem #5 - Loop & Conditional


Click Here for Link

The cat and the boy don't say anything because it's too fast and would only work with the forever loop, like the bear does.

Extra Creation

Click Here for Link

Click space bar the ball will change colors.

Questions and Answers:

  1. Scratch contains five types of loops. "Repeat # of times" loop, "forever" loop, "if then" loop, "if then else" loop and "repeat until" loop, all of which have different purposes and functions.
  2. The forever loop is the best structure to use when you don't know how long you want the actions to repeat for.
  3. A forever loop which is embedded in another forever loop will stop the first forever loop from fully playing out, making the 1st forever loop pointless.
  4. Sprites can broadcast to other sprites, triggering their action.
  5. The two codes are equivalent because the "if then else" loop, makes the first action happen if key is pressed and the second action happen if key is not pressed. Since the two codes are opposite of each other, they will play out to do the same thing.
Click HERE to return to homepage.