in reply to "Countdown" (golf)
The rules are you can only use the letters given and you can only use them as many times as they appear on the board.
Given that I dont think any solution so far actually solve the problem correctly. Also the question was to only list those which are of the longest length.
Here is my solution of 112
my @letters = qw(d u n s c a e y t); open(D,"/usr/share/dict/words") or die $!; print f(@letters); sub f { # 1 2 3 4 5 #234567890123456789012345678901234567890123456789012345 my%h;$h{$_}++for@_;my@b;push @{$b[length]},$_ for grep{ # 6 7 8 9 0 1 #78901234567890123456789012345678901234567890123456789012 my%g=%h;$g{$_}--for/./g;!grep{$_<0}values%g}<D>;@{$b[-1]} }
But I am sure someone will shorten it
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: "Countdown" (golf)
by dragonchild (Archbishop) on Nov 30, 2001 at 22:31 UTC | |
by blakem (Monsignor) on Dec 01, 2001 at 07:47 UTC | |
by stuffy (Monk) on Dec 01, 2001 at 08:17 UTC | |
by blakem (Monsignor) on Dec 01, 2001 at 08:38 UTC | |
|
Re: Re: "Countdown" (golf)
by stuffy (Monk) on Dec 01, 2001 at 08:07 UTC |