Patch #1b: Unlock the Safe!

In the original version of our Unlock the Safe patch we have used a coll object to save the secret code and compare the input of the user with it. In this patch, we use another alternative. We combine all three numbers into one list and then compare the created list with a solution-list. We use the zl object for that. The zl object is useful for all kinds of lists operarions. “zl compare” compares two lists and tells us which indexes differ.

First, we have to combine all three numbers the user chooses into a list. We can do that using the pack object. As the left inlet triggers the pack object , it we count backwards from 3 to 1 and use a gate to route the  first number in the most right inlet of the pack object, then the middle number in the middle and then the last number in the left inlet. Automatically, a list will put out of pack with all three values. We then use zl compare to compare the list to the solution.

The adapted part looks like this: