Sometimes we need to repeat several commands a lot of times and this would be very time consuming if we were to have to order all of the blocks by hand.
This is why the repetition block was created?
Sometimes we need to repeat several commands a lot of times and this would be very time consuming if we were to have to order all of the blocks by hand.
This is why the repetition block was created?
The repetition block is located in the orange block pallette:
Unlike the rest of the blocks, this block has a mouth and it can bite other blocks!
All of the blocks in its mouth will be repeated 10 times. As you can probably guess, if you change the number 10 in this block, then the number of times the blocks repeat will also change.
After the blocks in its mouth repeat enough times, the program will continue with the blocks underneath the repetition blocks.
This Tutorial is used in the following courses and lessons
"Keep 'em clean" is a game that uses the players' real-life movement captured by a camera to control many "people" and push them towards a sink where they wash their hands! In this course, you will learn the basics of programming with Scratch, as well as using the "Video Sensing" extension to receive movement from the camera!
It is interesting with just one character, but to have an actual game, we need to have more than one in order to have clean and dirty hands!
But how can we do that? Do we copy the sprite 10 times? Is there not a smarter option?
First, as a rule, you need to know that we never repeat anything ever. This is a universal rule that will help you make beautiful and optimal programs! Now you will learn about the first tool that can help you evade repetitions!