Help for this page

Select Code to Download


  1. 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;
    
  2. 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";
    
  3. 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";
    
  4. 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.
    ...
            }
        }
    }
    
  5. or download this
    my %seen;
    eval {
    ...
        }
        alarm 0;
    };