Help for this page

Select Code to Download


  1. or download this
        my @parents = @population[40 .. 49];
        shuffle @parents;
    ...
            while @parents;
    
        @population[0 .. 4] = map { mutate($_) } @children;
    
  2. or download this
    sub mutate{
        my @string = @{$_[0]};
    ...
        }
        return \@string;
    }
    
  3. or download this
                    my $temp = $string[$i][$position1];
                    $string[$i][$position1] = $string[$i][$position2];
                    $string[$i][$position2] = $temp;