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.
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
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.
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.
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.
What are parameters?
Parameters are fields where you input values into.
Give an example of a formula that takes at least one parameter
The distance formula, it requires 4 parameters.
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
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.