// previous page's name
$previous = 'conditions';
// page's name
$current = 'loops';
// next page's name
$next = 'variables';
// print top of page
In programming, a loop can induce multiple executions of statements. In Scratch, any block whose label begins with "forever" or "repeat" is a looping construct.
One such block is:
This construct allows us, for instance, to instruct a sprite to meow every other second:
Another block allows you to loop a specific number of times:
And another block allows you to loop until some condition is true:
Sometimes, you want execute some statement multiple times, each time varying your behavior ever so slightly. We thus turn our attention to variables.
// print bottom of page