I’ve just completed a Clash of code, shortest code mode. The goal was to sum up all the alphabetical indexes from the word given as input.
I end up with the following ruby solution (34 chars).
p gets.upcase.chars.sum{_1.ord-64}
Another guy completed the challenge with only 23 characters, in ruby as well. Unfortunately, he didn’t revealed his code.
Anyone has any idea of what kind of hack did he used to have such a small code?