in reply to Golf: 3 hole golf game
Here is my score:
Note that you might not accept my human.pl, it does have an artificial (though generous and easy to increase) limit in it. I used no modules. Here are my solutions.human.pl: 87 strokes shuffle.pl: 47 strokes select.pl: 52 strokes ------------------------ total: 186 strokes
human.pl ======== %x=map{($x=lc)=~s/\d+/0 x(999-length$&).$&/ge;$_,$x}@x=<>;print sort{$x{$a}cmp$x{$b}}@x shuffle.pl ========== $i=rand@x,@x[$n=@x,$i]=($x[$i],$_)for<>;print@x select.pl ========= $i=rand@x,@x[$n=@x,$i]=($x[$i],$_)for<>;print@x[0,1]
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Golf: 3 hole golf game
by dragonchild (Archbishop) on Nov 17, 2004 at 12:54 UTC | |
|
Re^2: Golf: 3 hole golf game
by eric256 (Parson) on Nov 24, 2004 at 16:26 UTC | |
by tilly (Archbishop) on Nov 27, 2004 at 08:26 UTC |