Page 92 - Viva ICSE Computer Studies 6 : E-book
P. 92
Do and Learn
Write a program to make Sprite dance.
Steps to be Followed
• Start a new project
• Add the codes in the Script Area as
shown.
• Click on the Green fl ag and observe
the Sprite dancing.
Control Blocks
Control blocks are gold colour coded blocks .They are used to control Scripts. These blocks are
enabled with logical reasoning and conditional programming concepts. Let’s understand the
functioning of some blocks.
Block Function
This block pauses the Script as per the specifi ed amount of seconds.
This block repeats the Script specifi ed within it, a given number of times. It
saves a lot of space and time.
This block repeats the blocks specifi ed within it by endless times. All the blocks
within this will be in a loop, that never ends until the Stop button is clicked.
The blocks mentioned within this block will be executed only if the condition
evaluates to be true. If the condition is false then the block outside it will be
executed and the blocks inside it will not be executed.
The block mentioned within ‘IF’ will be executed only if the condition evaluates
to be true. If the conditions evaluated to false then the blocks within ‘Else’ will
be executed.
This block repeats the block mentioned inside it till the condition evaluates to
be true.
80