For example 36 would be split into a 3 in the tens place and a 6 is the ones place. Is there anyway simple to do this? I figured out how to do it with while loops and stuff but I'm wondering if there's an easier way to do it
Develop games in your browser. Powerful, performant & highly capable.
You can divide it by 10 and then save it as integer to get the first digit(10). Then you can divide it again by 10 using modulo division to get the second digit(6). If the number is bigger then you can increase the division to get the other digits to 100, 1000, 10000 etc.
Let´s do it the easy way: tokenat!
tokenat(str(number), 0, "")
The number has to be converted to a string with 'str(1234)'
If you have variable lenghts of numbers you probably want to make use of tokencount and loopindex.