Scratch Lab #4

Problem #1 - Quick Costume Change


Click Here for Link

Problem #2 - A.I.


Click Here for Link

Problem #3 - Distance Formula


Click Here for Link

Questions and Answers:

  1. The variables in computer programming are not the same as in math class because they cannot be as simple as X and Y, rather we have to make them more detailed and explain what their function is, that way we can understand the code easier.
  2. A variable can either be seen by only one specific sprite or it can be accessed by all the sprites.
  3. A variable can only store one value at a time.
  4. Because both the values will be lost if they are out of their "box" at the same time. To fix this code, you must create another variable and switch the values through there.
  5. Value 1 and value 2 are swapping in this code, this is able to happen due to the temporary value, acting as a "third box" so the values won't be lost during the swap.
Click HERE to return to homepage.