in reply to PGA Golf, Round 1
# 1 -- 16 chars sub g1 { (pop=~/\w+/g)[4] } # 2 -- 19 chars (23 with newlines) perl -e'goto\ \ \ \ TPC' # 3 -- 23 chars # note: using $ instead of \z is *wrong* # note: using . without /s is *wrong* sub g3 { pop=~/^(.*?)\1+\z/s&&$1 } # 4 -- 12 chars sub g4 { pack"H*",pop } # 5 -- 29 chars sub g5 { $x=pop;$x<$_&&($x=$_)for@_;$x } # 6 -- 49 chars sub g6 { sort{($a=~/[aeiou]/g)[0]cmp($b=~/[aeiou]/g)[0]}@_ }
japhy -- Perl and Regex Hacker
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: PGA Golf, Round 1
by japhy (Canon) on May 24, 2001 at 22:02 UTC | |
Re: Re: PGA Golf, Round 1
by japhy (Canon) on May 24, 2001 at 22:44 UTC | |
Re (tilly) 2: PGA Golf, Round 1
by tilly (Archbishop) on May 24, 2001 at 22:55 UTC |
In Section
Meditations