Bug(?) with numbers, input, and strings

So I am making something and it needs you to set a 4-digit password using numbers. Because I am lazy, I chose to just use the set input block. I made all the code that makes it work, but you cannot put a 0 in the beginning. I am assuming this is because if you set it to 0926 (random number with a zero), it will automatically set it to 926. Anyways, this is frustrating and if any of you know a way to make it work, please tell me! If there is no way to do that, then I will just put in the prompt to not start the password with a zero.

Here is the code:

Code


8 Likes

It does’t work like that unfortunately

With Hopscotch anyways

5 Likes

Aw that is too bad. I guess I will just keep it as it is.

4 Likes

I mean, I could add 10^length(password) and just do it like that

4 Likes

That didn’t work never mind

4 Likes

I can make a demo for you later when I get the time.

3 Likes

Any 0’s before the actual number (anything greater than 0) will be removed automatically. There is an easy fix. You just need to use multiple variables to save each number and check if each one is equal to their correct counterparts…

2 Likes

Here is a project I made over 133 weeks ago: https://c.gethopscotch.com/p/z9pomd9by

This is a perfect example of how you can get it to work. Using a keyboard input won’t necessarily work because the length will be set to what the number’s length is after the 0’s…

You could try to put a random symbol before the number so it makes it keep the zeros…

3 Likes

Ok, strike that last part, it doesn’t work…

4 Likes

Wow thanks! I will try that

2 Likes

Ok, but any method to try to force a zero before the number will not work.

3 Likes
3 Likes

You could try and create a Hopscotch version of an onscreen keyboard, but that will probably be boring…

And, if the first char is inputted, a random symbol will be forced, but won’t alter the code…

2 Likes

Maybe…

2 Likes

But only if you force it yourself…

3 Likes

What…

3 Likes

That’s what my mind says time to time…

3 Likes

What…

2 Likes

But I am using the length variable so yeah I don’t know if it would work

1 Like

It doesn’t. The length is automatically set right after you hit “OK”.

2 Likes