Getting Started Guide
SCRATCH CODING KIT
Mole game activation coding
How to use the mole game block
Drag the coding blocks and make a script like the one above. Does the work make sense?
First, receive a ‘start’ broadcast from the top. Then, the blocks below will be activated in order. Save 0 at ‘Score’
variable, and 1 at ‘Timeout’ variable. Right now, there is nothing in the storage space in variables. Therefore, we
need to set the first value. After saving, play the sound file announcing the start. Drag block from the sound tab
and add it to the script.
Now you need to express “After the sound file announcing start is played, the computer will call up the numbers
1 to 6 and need to press the corresponding infrared sensor within the specified time.”
Now let's think about how to call an arbitrary number from 1 to 6 and how to behave when each number is called.
Make a script like the one above. The block ‘random number between 1~6’ is a block that produces the number
arbitrarily. Put in one of the produced arbitrary number into the ‘Action’ variable. After the number is saved in the
‘Action’ variable, connect it to the “If~” block. This block activates the script when certain situation , in this case
“number saved in the ‘Action’ variable = number inserted in the blank”, after the number is saved into the ‘Action’
variable.
For example, if the random number block has produced 1 and saved it to ‘Action’ variable, then the scripted inside
the ‘If ‘Action=1’’ block will be activated.
Mole game coding activity