Help for this page

Select Code to Download


  1. or download this
    sub fys {
        my $arr = shift;
    ...
            --$i;
        }
    }
    
  2. or download this
    @nums = map [ @{$_}[@cols] ], @nums;
    
  3. or download this
    my @cols = 0..11;
    do {
      fys( \@cols );
    } until is_deranged( \@cols );
    
  4. or download this
    sub is_deranged {
      my $arr = shift;
      $arr->[ $_ ] == $_ and return for 0..$#$arr;
      return 1;
    }
    
  5. or download this
    use strict;
    use warnings;
    ...
            @$arr[$i,$j] = @$arr[$j,$i];
        }
    }