I have this array of characters
it's the alphabet in order, with 10 of each character, so that's 260 characters.
Given an index between 0 and 259, how can I create a function that can return the expected letter with only knowledge of the alphabet itself (a-z)?
One simple way would be:
index_of_letter = floor(index/10);
so if index is 9, it would yield floor(.9), which is 0, which would be the letter
a in the standard western alphabet. If the index was 259, that would yield floor(25.9) which would in turn yield z.
However, isn't there a way to do this with
modulus instead of using a
I can't figure out how to do this with mod, but I am sure there is away to do! Anyone know how I could do this with mod?