in reply to Golf Challenge: all elements of an array equal
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Golf Challenge: all elements of an array equal
by MeowChow (Vicar) on Jul 14, 2001 at 03:02 UTC |