- or download this
#! perl -slw
use strict;
...
## form our guess from the highest scoring words in each category
my @guess = map{ $cats[ $_ ][ 0 ] } 0 .. $#cats;
my $best = calcScore \@guess;
- or download this
my (@candidate, %freq);
while (<DATA>) {
...
}
my $total = sum(map {my $n = $let{$_}; ($n * $n + $n) / 2} keys %let);
print "$total : [ @solution ]\n";
- or download this
my (@candidate, %freq);
while (<DATA>) {
...
}
my $best = sum(map {my $n = $let{$_}; ($n * $n + $n) / 2} keys %let);
print "$best : [ @solution ]\n";
- or download this
## Loop over the categories swaping the other words in that cateory
## for the guessed word. If we get a better score, start again.
...
}
}
}
- or download this
my %seen;
eval {
...
}
alarm 0;
};