When Ruby comes to help!
Recently I have been trying to solve problems on the SPOJ online judge. Earlier I used to write in C then C++ and now in C++ andd Ruby. SIZECON is a challenge problem where you have to write the shortest code to summate positive integers give by users. The score is on how short you write.
This is where C/C++ won't help you out, you have to look foreward to how perl hackers write cryptic codes.
Heres my best solution in Ruby
This one gets 48. Anyone got better solutions in Ruby?
Perl hackers have written 6 byte codes... that still seems impossible :O in a way.
The best in perl I could get is
thats 34 bytes, but sadly fails to compile on the judge :(
Anyone got better insights ?