Help for this page

Select Code to Download


  1. or download this
       parent 1: "aaaaaaaaaaaaaa"  (these are only copies -- the parents a
    +re
       parent 2: "AAAAAAAAAAAAAA"      not modified in this operation)
    ...
          and then swap sections..
       result 1: "aaaaaaAAAAAAaa"
       result 2: "AAAAAAaaaaaaAA"
    
  2. or download this
    use strict;
    use List::Util qw/shuffle sum/;
    ...
    sub rand_string {
        join "" => map { rand() > 0.5 ? 0 : 1 } 1 .. $str_length;
    }