dbk: Delete the `.check` file after the write test
[sunny256-utils.git] / mixline
blob1339e33f208df9d169f569f5623ea7aa3cfd3cc8
1 #!/usr/bin/env perl
3 # mixline
4 # File ID: b1e95adc-5d3f-11df-b77c-90e6ba3022ac
5 # Blander linjer tilfeldig.
7 use strict;
8 use warnings;
10 my @Linjer = <>;
12 mix_array(\@Linjer);
14 foreach(@Linjer) {
15 print;
18 sub mix_array {
19 my $array = shift;
20 my $i;
21 for ($i = @$array; --$i; ) {
22 my $j = int rand ($i+1);
23 next if $i == $j;
24 @$array[$i,$j] = @$array[$j,$i];
26 } # mix_array()