#!/usr/local/bin/perl -w # perm.p returns a permutation $n=256 ; $seed = 0 ; eval "\$$1=\$2" while @ARGV && $ARGV[0]=~ /^(\w+)=(.*)/ && shift; # invent a perm print STDERR "Starting perm $nrandperms+1\n" ; for ( $q = 1 ; $q <= $n ; $q ++ ) { $qs[$q-1] = $q ; } for ( $nl = 1 ; $nl <= $n ; $nl ++ ) { $from = $nl ; $q = int ( rand($#qs+1) ) ; $to = splice ( @qs , $q , 1 ) ; print STDOUT "Rand8[$from]=$to;\n" ; }