SOS! Problem with co-ordinates

Hello mates. I need to create a table with co-ordinates such as in chess table :
horizontaly with numbers 1,2,3... and vertically with letters - A,B,C,D. There comes a problem. While in chess the table is 8x8 (you simply use the letters from A to H), in my case the table has size MxN. Otherwise its size is unlimited! And i cant think of a way to count with letters instead of numbers ;(
|
Considering there are 26 letters in English, 27 will be equal to AA, 28 = AB , AC, AD....AZ, AAA, AAB, AAC, AAD and so on. (as in MS Excel). But how to count with char ?
[edit] Sorry about spamming. I removed the other posting.
Last edited on
Don't use char. A co-ordinate is a number.

Just write a pair of injective functions that convert between the alphabet version for humans and the number.

Hope this helps.

[edit] Please don't spam forums. If no one has as yet replied to this question in the General forum, please go delete it.
Last edited on
Topic archived. No new replies allowed.