Name: Colin Yang

Period: 7

Assignment: Lab #8

Finch Lab Part 1-A: Calibration

This lab asked us make the finch move foward, backwards, left, and right according to the button that is pressed by the user. In addition, a variable "blocked" needs to be created to determine if the finch is obstructed.

My Solution

My solution included four different blocks, with the "forward" block defined as the finch moving 100 left and 100 right, the "backward" block defined as the finch moving -100 left and -100 right, "left" block defined as the finch moving -100 left and 100 right, and the "right" block defined as the finch moving 100 left and -100 right. Then, we made it so that if the green flag is clicked, there will be four different if statements, with if a certain key is pressed, a certain block will occur (for example, if the up arrow is clicked, the "forward" block is played).

Finch Lab Part 1-B: Problems

This lab asked us to make a program that makes the finch go in a square shape, a figure 8 shape, go back if it detects an obstacle, and say something in each orientation.

My Solution

My solution involved a "square" block that had the finch move 100 left and 100 right, wait 2 seconds, move the finch 100 left and -100 right, wait 0.4 second, and repeat the same process four times to make a square shape. We then had a "find" block that stated that if the finch is touching and obstacle, it would go backwards, rotate 180 degrees, and move forwards. The "speak" block stated that if the finch orientation is greater than a certain number, it would say a certain statement. The "figure 8" block stated that the finch would move forward, turn a certain angle, and move forward again in a way to form a figure 8 shape. Finally, when the green flag is clicked, we had it so that if a certain key is clicked, it would perform what the block asks us to do.

Build a Calculator

This lab asked us to make a scratch program that would take two numbers and either add, subtract, multiply, or divide the two numbers.

My Solution

My solution included 4 different blocks with 2 number inputs each. The block would say "number 1" added, subtracted, multiplied, or divided by "number 2" according to the block. When the flag is clicked, the sprite would ask the user what the first number is, and set the answer to the variable number1. Then it would ask the user for the second number and set the answer to the variable number2. Finally, it would ask the user if they want to add, subtract, multiply, or divide. If the answer is equal to Add, then it would "add" block number1 and number2. The same concept applies to the other 3 blocks.

My Project Link