I just realised I changed my username on hopscotch but it still shows as my old username on my profile, does anyone now how I can update it?
So I have been stuck on a problem that I can’t find a good solution for. I do have a solution but it’s not very good…
So basically, in hopscotch, when you have a number with 0’s in front, hopscotch automatically deletes those 0’s.
So 0056 becomes 56.
But the thing is, is that in a project I’m working on, I have a variable, and this variable is supposed to store a number. And this number often has 0’s in front.
This usually isn’t an issue as hopscotch automatically removes 0’s in front of a number (which is what I want), but this doesn’t happen with negative numbers.
So 00-56 doesn’t become -56, as hopscotch treats 00-56 as a string, not a number. And I was wondering if someone had a way to convert this string to a number.
(Characters in (00-56) between 2 and 5) * 1 ???
The fact it doesn’t remove the zeros from 00-56 automatically makes sense as the negative sign is also known in string as a hyphen. The only ways to get rid of the zeros here is to do it manually.
Go to: preferences (click your pfp at the top of your screen), then go to profile, then scroll down until you find the Hopscotch username section. It’s also where you would go to change your bio.
That doesn’t work as in my case the negative character can be in different positions in the string, and the string can be different sizes.
Then there’s no way to do it. Unless you want to do frame recursion to search for the negative sign in the potentially huge string (which can cause crashes if the string is very very large).
It would be very limited, and after a certain point it’s no longer possible to do it in one frame.
use ThinBuffaloSr’s search char algorithm (the efficient algorithm, plus you can use it anywhere else in your code as much as you wish)
import Awesome_E’s secret blocks
write this in your code
Set pos0 to "Character at 0" matches "-" Set pos1 to "Character at 1" matches "-" Set pos2 to "Character at 2" matches "-" Set pos3 to "Character at 3" matches "-" Set pos4 to "Character at 4" matches "-" Set pos5 to "Character at 5" matches "-" [...] Set pos to "pos1" + "pos2" + "pos3" + "pos4" + "pos5" + [...] Character in (00-56) between pos and Length(00-56)
both methods are instantaneous
edit: see discussion below, and dont take method 2
This won’t work because their string can be ANY length (besides the required specific lengths it needs to be for the code to work correctly).
i dont see why my codes have length limitations
ok for the 2nd one maybe theres a length limitations, but thats not true for the first one (if you copy enough codes you’ll reach till 16384+++, which would surprise me if spy guy reaches that numb)
Method 1 requires it to be at arbitrary lengths (2, 4, 8, 16, 32, etc.)
Method 2 looks like it’ll take too much blocks for what they want to do (1000s of them, potentially).
dont think thats true /little-conf
my kahoot project def doesnt have these specific length and it works perfectly
edit: oh wait do you mean inside the ability? yea just copy the code a bunch of time and you’ll reach terrifically big numbers - even more than js limit maybe!
It literally mentions the whole arbitrary thing (“of arbitrary lengths”) in their project.
ik, missunderstook the sentence , see edit
i thought you meant the string needs to be at a specific length ↩︎
The frame recursion method I use is instantaneous up to 500 characters, less if you own a slower device (which, at that point, use method 1).
may i give you the challenge to create a recursive regex search char?
Would it be easier if the string was a set length of 6?
As long as it works with that, I can get my code to work.
My current method is to check for every position the “-“ can be in but that isn’t a good method at all and I was hoping someone had a more simpler/efficient method.
You might be able to get away with that…
I already did (find index of character in string v3). It’s in my profile.
Do keep in mind that this will not just remove zeroes, but anything that is not a digit between 1 and 9 or a -. You can change what it stops removing at by playing the the regex.
Removing the characters is the easy part, adding them in the first place is really annoying with Characters between block no longer always returns a string not being fixed.
How are you doing it?