Array problem

I have to create a program which generates a permutation of the alphabet (which for this is "ABCDEFGHIJKLMNOPQRSTUVWXYZ.,' ") and returns the inverse permutation.
I.e
alphabet abcde
permutation debca
invperm ecdab

I have the code to generate the random permutation, I just need to do the inverse,
my idea was to have it as an array of 31 long and 3 down, and have alphabet in the first row, perm in second row and then use them to work out the inverse and put it in the third row.

It would do some sort of loop, starting by taking the character in the first position in the first row (A), looking at the character in the position below it and work out the numerical value of that character (B) 0-29 in accordance to alphabet ( which I also have code that can convert the character to the number, but it is fairly long). It would then copy A into the horizontal position B of the 3rd row.
It would then loop (or something) and do the same for all the other characters.

I just don't know how to code that.(and sorry if any of that is poorly explained)
Topic archived. No new replies allowed.