2020-08-12
in the last class, we have used the function to program. and we know that in Scratch, it means we make our own function through make a new block.
In this class, we will transfer parameters to the function, and in this way, the interactivity will be increased.
this function will draw a polygon with the input parameters: length and number.

we should program this function.

the function will be used in the main program shown below.

the cat will ask you the parameters. and when you input the parameters, it will begin to draw the polygon.
it seems that we can involve all the codes into the main program. but that will make the main program longer and less readable.
so it would be better to use the function to make the program more clear and clean.
please try it.
https://scratch.mit.edu/projects/417238841

网友评论