Update: Spotted the mistake in all_eq0() but MeowChow beat me to it. And then beat me some more. ;-)sub all_eq0 { @_{@_}=2; !((@_=%_)-2) } # 21 chars but wrong as per MeowChow sub all_eq1 { local%_; @_{@_}=2; !((@_=%_)-2) } # 29 chars sub all_eq2 { my%h; @h{@_}=2; !((@_=%h)-2) } # 26 chars
In reply to Re: Golf Challenge: all elements of an array equal
by jmcnamara
in thread Golf Challenge: all elements of an array equal
by princepawn
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |