Try This: Randomized Vault Key
If you are doing these activities by yourself, or want to make it to where you won’t have any knowledge of the PIN you are trying to crack, then modify the bank_vault_receiver project to create a random pin.
Example project: bank_vault_receiver_random_pin
- Duplicate bank_vault_receiver as bank_vault_receiver_random_pin.
- Make the changes to the project shown and described below.
Change the set pin to block.
Add a for loop right under set pin inside the on start block.
The rest of the blocks should stay the same.
- Open a terminal in a browser to view messages from the Bank Vault Receiver micro:bit.
- Try pressing and releasing the reset button a few times (at least 1 second apart).
Each time you reset the Bank Vault micro:bit, it should display a new random PIN in the terminal. (Don’t worry if your random sequence is different from what’s shown here. Yours only has a 1 in 8 chance of matching for any given reset.)
- Make sure the PIN Pad Transmitter micro:bit is still running bank_vault_crack.
- Press/release the PIN Pad Transmitter micro:bit’s reset button, then its A button to restart the project and find that randomly determined PIN.
How it Works: vault_receiver_random_pin
In the place of a previously decided PIN, there is now an empty string and a for loop that repeats three times—randomly choosing a 0 or 1 – and then appending the pin string with that digit.