Users Manual
SCRATCH CODING KIT
Tori Secret Safe Problem 4 commentary
Now let's create a script when we receive the 'Save_Password' broadcast. The main function of the 'Save_
PasswordReceived' script is to store the entered number as a password. Here we use the variables 'index' and
'keycnt'.
Create a script like the one above. When receive the broadcast, it’ll store 1 in the 'index' variable.
The 'Pointer' variable now has a cumulative number from 1 to the number entered by the user. Accumulate the
value of the 'index' variable by 1 and save the number entered in the 'Code' list as a password in the 'Key' list in
the order of the items until it becomes 'index = Pointer'. When 'index = Pointer', exit the block 'repeat to'. Delete
all items in the 'Code' list. It deletes all the input numbers so that they are not left.
Then, save the value stored in the 'Pointer' variable in the 'keycnt' variable. 'Pointer' variables are accumulated
from the number starting from 1, and they are stored in the variables that are responsible for the number of digits,
so that it can compare digits when you input them again later.
Commentary