Scratch Lab #8

Name: Robby Rowell

Period: 7

Assignment: Scratch Lab #8

Lab Overview- Problem 1

For 1a, we had to make simple blocks with the finches that moved them forwards, backwards, left, right, and recognized if they were being blocked by something. For 1b, we had to make it move in more complicated ways, such as in a square, figure eight, and out of the way of obstacles, and we made it say things when placed in different orientations. Find my Project here Here

My Solution

Our solution to 1a was to create blocks for all different directions of movement. For move forward, we had each wheel move at a speed of 100, for backwards we had both move at a speed of -100, and for move right and left we had one wheel move at 100 and the other move at -100. For 1b, we put together some of blocks from 1a to make it move in a square, then played with the amount of time it spent performing each movement to make a figure 8. To get it to move out of the way of obstacles, we made an if statement with the left sensor and right sensor blocks, then had it move backwards and to the left if either was blocked. To talk, we made if statements containing each possible orientation and had it say something different in each one.

Lab Overview- Problem 2

For problem 2, we had to create a calculator that added, subtracted, multiplied, and divided. We also added the optional steps of exponents, factorials, and factoring.

Lab Solution

Our solution to problem 2 was to ask a question asking for a number, then setting that number as the variable "input 1". We then asked for what operation they would to perform, and set that answer as another variable. We then asked for the final number, which we set as the variable "input 2". Depending on which operation the user asked to perform, a different if statement was performed. These if statements each had operator blocks inside that could add, multiply, divide, etc the two inputs. The calculator sprite would then say the answer, which was set as variable "answer".