Compare two texts with the Compare block and use Not to know when the password fails.
This tutorial is part of the Nairda learning path. You can build it step by step inside the app, which checks every block you place before letting you move on.
The steps
- We add a While loop, which repeats forever.
- We create a text variable called password.
- We create a number variable called wrong.
- Inside the loop we save whatever is typed into password, using Wait.
- Behind it we set wrong and give it the Not block.
- Inside the Not we put Compare, which is 1 when the texts match.
- We compare the variable password against the password sun.
- On the dashboard we draw a terminal and give it the variable password.
- We add a label with wrong, which is 1 when the password is not sun.
When you finish, the app takes you straight to the next tutorial in the path.