Runes in Go loosely equate to the "charcode as an int", and are represented by single-quotes.
It's definitely a bit 'black magic', but it says:
Take the charcode stored in c, take off the charcode of "a" (97) and add the charcode of "A" (65). Then, convert the result back to a string.
So, for example, the letter "r" has ascii value 114. 114 - 97 + 65 = 82, which is the charcode of R.
I managed to find a solution < 300 chars, but it took me quite a while as C# is wordy and has lots of boilerplate. As such, perhaps we should set the limit higher for C# (say 350 or 400) to keep this at a 7kyu level...thoughts welcomed.
Runes in Go loosely equate to the "charcode as an int", and are represented by single-quotes.
It's definitely a bit 'black magic', but it says:
Take the charcode stored in c, take off the charcode of "a" (97) and add the charcode of "A" (65). Then, convert the result back to a string.
So, for example, the letter "r" has ascii value 114. 114 - 97 + 65 = 82, which is the charcode of R.
Good to know, thanks!
I had just copied the python one, which I've also fixed now.
The Haskell sample tests have the solution-method in them. Probably shouldn't!
Haskell translation
Haskell translation
True. Let's leave for a bit and see if people manage to solve.
The Haskell solution also expects a trailing
\n
and that's what I based the Go one on. Happy to change if there's a consensus.I managed to find a solution < 300 chars, but it took me quite a while as C# is wordy and has lots of boilerplate. As such, perhaps we should set the limit higher for C# (say 350 or 400) to keep this at a 7kyu level...thoughts welcomed.
This comment is hidden because it contains spoiler information about the solution
Go translation