Name: Zak "The Legend" Singh
Period: 7
Assignment:Scratch Lab #8
For problem 1A, we had to make blocks for "TurnRight" "TurnLeft" "moveForwards" "moveBackwards" for the Finch. We also had to make a "Finch Left Obstacle" and "Finch Right Obstacle" boolean value.
For problem 2, we had to create a calculator that could perform the four basic operations of addition, multiplication, subtraction, and division.
For Problem 1A, we made defined our blocks as moving the wheels the proper amount to turn or move the amount necessary. The Finch would then check if it was blocked on either side and then set a variable to the corresponding value. We then checked for the value of the variable, and depending on what it is, the Finch would move to avoid the obstacle.
For Problem 1B, we first made the Finch move in a square using our previous blocks we defined before. For the next question, we used the finch orientation to detect when the beak was down. It would then say "my beak is down". We got the Finch to back away from obstacles using the light sensors on the Finch.
To make the calculator, we first defined the 4 operations the calculator can perform (addition, subtraction, multiplication, divison). We then made 4 spries, one for each operation, as buttons. We used variables that would change depending on your input for the two starting numbers and the answer. Depending on what operation was selected.
Problem 2