Users Manual
SCRATCH CODING KIT
Enter the Tori Secret Safe Number
Create a script like the one above using the script you created in the previous page.
There is an 'iterate through' (repeat until) block in the 'infinite loop' block that keeps repeating the script inside.
'Repeat to' (repeat until) block is a block that executes internal scripts until a certain condition is reached. As
shown above, the condition of the block 'to repeat' is 'Analog 4 sensor value <90'. Input Analog port 4 has an
infrared sensor connected. In other words, it keeps running the internal script until the analog No.4 port infrared
sensor is smaller than 90 (until the infrared sensor is pressed). I've covered the script inside the 'repeat to' block
above.
If the Analog 4 port infrared sensor is pressed, it will exit the block until 'Repeat to'. After that, it will broadcast
'doolock check'. 'doorlock check' is a script that activates the door if the '1234' password is present, or not. I'll
take a closer look at 'doorlock check'.
We have now created a script that will enter the number with the button sensor connected to the
analog 0 port, inform the infrared sensor connected to the analog 4 port that the number input is
finished, and compare it with the password. Now let's create a script that connects to ports 1 to 3
analog!
Activity