Return to Scratch

Scratch Lab 6

Name: Miles Wiesenthal

Period: 7

Assignment: Lab #6

Lab Overview

This lab focused on variables and compound conditionals. We already learned how to use variables to store data and recieve user input. This lab we learned how to nest conditionals, and make complex logic. One I had was to create a rock paper scissors game with user input. I also had to create a person switching costumes at a speed I can adjust, and another variable tracks the maximum speed.

My Solution

I decided to modify the rock paper scissors problem into a game I had invented previously, with the exact same rules. It's called sponge fire water. I put a lot of time into making it look good and have good controls. I used if statements to detect which the player chose, and check if they won or lost based on the enemies choice. The other project I was more hasty on, because I spent a lot of time on the first problem. I had actually already worked with maximum, because I previously made a high score in a personal game. To do it, I checked if the speed was higher than the maximum speed, and if it was, I set the maximum speed to speed.

Problem #4

Problem #2

Questions

  1. Variables in computer programming are sort of similar to those in algebra, because they both are placeholders for numbers, and both can change and thus change an equation. But they are not the same because you are not trying to solve for them, you set them.
  2. A variable can be a string or a number. If it's a number it can be used in calculations. Either way it can be displayed, or used as a placeholder.
  3. A variable can store one value at a time.
  4. Value 1 will become value 2, and value 2 will stay the same. It doesn't switch them because value 1 becomes value 2 slightly before. You would need a placeholder value.
  5. Value 1 becomes value 2 and value 2 becomes value 1. This happens because value 1 is stored in temp, then it changes to value 2, but temp stays the same. Then value 2 becomes temp, effectively switching them.