Users Manual
CLASS 3
128
Tori secret safe door open comparison coding
You should have learned that the broadcast you are comparing, when you close the door, against the password
is 'Close_Check'. Now, create a script that compares passwords when you open the door. The name of this
broadcast is 'Open_Check' for association. The role of the 'Receive Open_Check' script is to compare the entered
numbers against the passwords to see if they match, and if it does not match, open 'Password_error'.
First, when you receive the broadcast, save '1' in the 'Pointer' variable. Save '1' and use 'repeat to block'. The
condition is 'Pointer> 4'. If you use the 'Pointer = 4' condition, the 'Pointer' variable will be 4 when you click
'Repeat to block' because it exits the ‘repeat to ~’ block. Use ‘If’ block for internal script. The condition is “’item in
Code Pointer position = item in Key Pointer condition’ is not true”. If the items in the 'Code' list where the entered
number is stored and the 'Key' list in which the password '1234' is stored are the same, exit the ‘repeat to~’ block
and delete all items in 'Code' and broadcast ‘Open_Door’.
Activity