Programming - Definitions
Some elements of programming include:
Loops can be infinite. In this Scratch example the program will continue to loop until exited. |
The Scratch Jnr program on the left shows a sequence of commands (the input) including a loop where the commands: 'move 100 steps then turn 60 degrees' are repeated six times. Each move after the first 100 steps and 60 degree turn is an iteration.
At the end of each 100 steps and 60 degree turn the program will ask itself if 6 repeats have been completed and make a selection of either stopping if the answer is yes or repeating the action if the answer is no. On the right the output of that program are shown. Below is similar code using Tynker instead of Scratch Jnr. Underneath those is the code using Javascript. Sequencing, Selection & Iteration
|