16
So we're all hopefully familiar with Spreadsheet 'A1' cell notation.
It's simply an alphanumeric representation of the positioning of said cell within a grid. The letter(s) represent the column positioning of the cell, and the number represents the row.
The 'letter' part can consist of 1 or more letters from the 26 letter English alphabet, all of which must be capital letters. These map to numbers through the use of 26-adic bijective numeration. The 'number' part can consist of any positive, non-zero integer.
The challenge, write a program that given the A1 notation of any cell as a single string, can output a string containing the column position represented as a number, followed by a space and then the row number.
Sample Input/Outputs below:
A1
>>1 1
B10
>>2 10
AC4
>>29 4
AAC753
>>705 753
F123
>>6 123
GL93
>>194 93
This is my first challenge, hence the relative simplicity and potential poorness of the criteria.
EDIT: String must be letters followed by numbers and the winning criteria is the shortest code length (if that can be a thing)
EDIT: Related to this but does the reverse process with a different starting index. Some may argue that this fact makes the linked puzzle more interesting.
Can we take the input as, for example, an array containing the letters and the numbers:
["A", "1"]
– Stephen – 2017-08-16T00:27:24.457related: https://codegolf.stackexchange.com/questions/54105/all-your-bijective-base-are-belong-to-us
– Maltysen – 2017-08-16T00:27:45.590@StepHen I suppose that would be too easy. One of the work is to parse the string. – user202729 – 2017-08-16T00:27:59.177
1@StepHen No. It must be a single string containing both the letters and numbers. I should probably add, also, that the string MUST be in the order of letters followed by numbers. – dbr – 2017-08-16T00:28:16.293
1We usually allow more flexible input and output formats, such as choosing newline instead of space as output separator – Luis Mendo – 2017-08-16T01:17:27.243
@LuisMendo Why is this? Surely part of the challenge is conforming to stricter requirements, otherwise some problems including this one are much more trivial. – dbr – 2017-08-16T01:18:54.930
3@DeanBrunt It depends on you, and of course you can enforce a strict format to make the challenge more difficult. But people usually enjoy the difficulty in the actual computations more than in the format – Luis Mendo – 2017-08-16T01:21:12.760
4It's because the formatting does not add any value to the actual challenge itself – Adnan – 2017-08-16T01:22:57.603
Are we allowed leading space and/or trailing newline? – Greedo – 2017-08-16T12:05:45.087
@Greedo No we're not I'm afraid. – dbr – 2017-08-16T20:49:10.570