How do I find a certain character inside of a word/number?

So normally you would just use a block or some type of command to find a character inside of a value, however in GKC there is nothing to do this. I have discovered that repeaters can be used to replicate loops(for looops) and well it can help me find what I am looking for by looping through the value. Although, this is useful I cannot find a way to check inside of blocks if the value has been found without using exact numbers. Is there a way to do this?

Indexing is hard to do, you should ask @getrithekd, @ClicClac, or @Blackhole927.

Got it thanks.

Doing words is near impossible, but with numbers, you use remainder and base n

Ah got it. So no one has found a way to index with words?

getRITHEKD has been summoned

There is one, but it would be way easier and less memory intensive to use numbers.

Alright then what is the way for words?

You use recursion to brute force yourself to build the string. After that, indexing is a long way that I haven’t thought about because I don’t like brute forcing.

I’ve heard a lot about recursion, but what exactly is it?

Look at the guide for concepts. I’m on mobile right now, so I don’t want to go into details

Got it.

1 Like

You could also just take off the first number of the string, store the new string until your desired number is at the beginning, then divide it by 10^(new string length), and floor it. That’s it!

Alright, let me check that out!

If you need coding help, ask @blackhole927.

Can you show me with a picture how it should look(code wise) or just write it out in more detail? E.g, var len = length of var word.

Okay. So, you first take the length of the string. Divide the string by 10^(string length). Floor it. If that is the number you want, stop. If not, mulitiply it (the one digit number) by 10^(original string length) and subtract this new number from the old number to get the new string. Repeat until you get the number that you want.

But, indexing doesn’t exist.

Wdym? Just use multiple properties to store the values while calculating.

That’s impractical.