My Scratch Stuff

Scratch Lab #7

This is our seventh scratch lab of the year. In this lab we learned how to go outside the boundaries of scratch and make our own blocks. This time I only had time to do the minimum 2 required problems.

Pair Programming

This pair programming assignment was a little bit harder than previous ones. It was our first experience with creating our own blocks, so the process was a lot of trial and error.

Pair Programming assignment #7

Problem #1: Distance Formula Revisited

In this problem, we went back to our distance formula assignment and recreated it using our own custom block. Since I knew how to use and create custom blocks, the program came out really compact. It was much more compact than my original distance formula program.

Distance Formula Revisited

Problem #2: Feet to Miles or Inches

This problem was very similar to another problem, the metric converter. Again, due to the custom blocks, the program was much simpler than the metric converter.

Feet to Miles or Inches

Questions for Scratch Lab 7

Question #1: Blocks

What are two advantages to using blocks for code repetition?

The main code is much simpler and things can be repeated without taking up too much space.

Question #2: Parameters 1

What are parameters?

Parameters are fields where you input values into.

Question #3: Parameters 2

Give an example of a formula that takes at least one parameter

The distance formula, it requires 4 parameters.

Question #4: Paramters 3

Give an example of a situation where no parameters are needed

A code block that does a predefined action, with no input from the user

Question #5: Block

Explain what you think the following program does? How do blocks make this easier to understand? Explain what you would expect within each block.

I think that this block puts names into a list and shuffles it until a certain condition is met whenever the block "alpha order" is used. Without blocks this would likely take up a lot of space with more duplicate code. I would expect each block to be very simple and compact.