in reply to Code Shortening (golf) [RESOLVED]
My general golfing advice is to try to use $\ as the accumulator if you possibly can because you can then print it with a bald print.
For example, this one is six strokes shorter and gives the same result as yours for the three test cases given at the spoj web site:
Don't know if it's generally valid though.$\+=~y///c&3for<>=~/([a-z]+)/g;print
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Code Shortening (golf)
by Young Monk (Novice) on Oct 19, 2010 at 17:30 UTC | |
by eyepopslikeamosquito (Archbishop) on Oct 19, 2010 at 20:35 UTC |