En op 11 juni 2002 sprak Stephen Turner:
> I was hoping to use formline ...

Like Ton, I am very reluctant to spend precious time
investigating long functions like formline (even
sprintf) during a golf game.

To try to prove my point, I have listed the current
known best solutions to previous golf games along with
a frequency count of words; the longest so far is
6 characters (splice, strtol, printf):

Language elements:
print   9
s///    8
//      6
for     6
pop     5
map     4
sort    4
y///    3
lc      2
while   2
splice  2
rand    2
uc      1
ord     1
last    1
exit    1
printf  1
split   1
warn    1
strtol  1
if      1
sub     1

Command line options:
-p 9
none 6
-l 3
-0 3
-a 2
-n 1
-F 1

Current Known Best Solutions
----------------------------
I expect Mtv to improve on some of these. ;)

santa 1 (11/various):
-p 11..exit
-p 11..last

santa 2 (19/various):
print+(<>)[-10..-1]

santa 3 (13/eugene):
-p $\=$_.$\}{

santa 4 (25/various):
-p0 $_=$1while/.^(.+)^/ms

santa 5 (21/various):
printf"%010d\n",$.,<>

irc 1 (58/bob):
-paF s!|\d+!$^T+$+[0].$&!eg;$;{+uc}.="@F\n"}for(@;{sort%;}){

irc 2 (32/various):
-p splice@a,rand$.,0,$_}for(@a){
-n splice@x,rand$.,0,$_}{print@x

irc 3 (35/karsten/eugene/andrew):
print+splice@,,rand@,,1for[@,=<>],f
-p splice@a,rand$.,0,$_}{($_,$\)=@a

even 1 (40/eugene):
-p $_ x=1&~$.&split$&while aeiouy=~/.?/g

even 2 (25/various):
-0p s/
//g;warn y///c.'
'

tpr00 1 (33/various):
-l use POSIX;print~~strtol pop,36

tpr00 2 (44/postmortem/rick):
$\=ord(lc)%87%48+36*$\.$/for pop=~/./g;print

tpr01 (46/postmortem/ton):
-l $_=pop;s;.;print,s,,$&*1.11%10if/../g,eg;eg

tpr02 (61/lars):
map!s/
^/ /m|//||print,sort%0for map$0{0,sort/./g}.=$_,sort<>

tpr03 1 (34/various):
s/./$& $&/gfor($\="-
")x pop;print

tpr03 2 (51/postmortem/mtv):
-l print map$_=$ARGV[($.+=!--$.[$.])%2],@.=(0)x pop

tpr04 (149/postmortem/mtv):
#!perl -ap056
sub
t{lc=~y/aeiouy//.v47.s/\w/$&/g}$_=/\./&&(@z=map//?t:$_^t^($_^=t^t),@F).":
@F
".t.":  @z
";y/\0/ /;s/(   .{57})...+(.
..*     .{0,56}\S+).*/$1..$2/

/-\ndrew

Reply via email to