Help with entering an alphabetic code

I figured out how to have someone enter a number to satisfy a condition to make something happen. For example, once they put in the proper number code here, they get access to a key.

How do I do this where they enter a word to satisfy a condition? For example, enter a keyword to open a door.

Thanks

1 Like

this is really cool! Can you make it remixable so I can check out your code?

Done. Thank you for doing this.

The easiest way is creating keyboard and I see that in your example you have already implemented 3d keys for all letters!

But it only works for numbers. Putting in the right number code opens the cabinet. I can’t get it to open if you put in the right alphabetic code.

I made a converter, which takes the letter keys and assigns a number to them, and that works, but why doesn’t the alpha work?

Thanks

The alpha doesn’t work because you compare the variable with string literals with “2”. If you change the comparison to string with letters, it would work

I know there is a 2 in there. I can’t change it to anything alpha. It keeps reverting to my previous entry of 2.

You can take a string block from the “Data” category and then you will be able to edit the string:

That does it. Thanks so much!

My only other issue is that students sometimes mistype their names, and have to start over. How can I have a reset button reset the string? Thanks.

You could add a © button that sets the entered string to “”

I tried, but it didn’t work

Thanks

I have changed the resetting strings code and now it works:

Please, feel free to remix the updated project here:

Thank you! That did it! Good job.

https://edu.cospaces.io/AYB-QRK