Here's how mine works:
When the user clicks on a dial (numbered brick in front), the brick increments 1. There are 3 dials, so 1000 different combinations.
Once the user presses the top blue button, a relay is fired down to the top dial. On a relay hit, the dial will fire a projectile back to the brick behind it, decrementing 1 print count for each projectile fired. The number on the brick is the number of projectiles fired backwards. Once the counter reaches 0, it fires a relay to the brick behind it, and fires a relay down to the next brick.
The brick behind the dial has 10 decrement 1 events, with only one enabled. With every projectile hit, the lock toggles each event. In order for the entered number to be accepted, the user needs to toggle the one enabled event off. With all the events off, the brick will cause a printCountOverflow, meaning the password is accepted. If the wrong number is entered, another event is toggled on, canceling the overflow by decrementing 2. If a printCountOverflow does happen, the brick fires a projectile to the dial brick, which will fire a projectile down to the dial brick below it.
Once a number was accepted or declined, the lock brick resets its' toggle status. That way, the password is saved on the bricks. The user can change the password in the back; it just changes how the password brick resets itself.
This goes on for 3 bricks, finally terminated by the 1x1 brick under the dials. With each correct number, a dial is ultimately fired to this brick. In order for the password to be accepted, three projectiles must be fired to this brick, terminated by a relay. If this happens, the password is accepted, and the door opens.