- or download this
sub pickAll{
my @weights = @_;
...
}
return @order;
}
- or download this
#! perl -slw
use strict;
...
print "\n";
print join ' ', pickAll( @weights ) for 1 .. $REPS;
- or download this
C:\test>WeightedPick.pl -SHIPS=4 -REPS=30
0 : 14.4176797792315
...
0 2 1 3
3 2 0 1
0 2 3 1
- or download this
C:\test>WeightedPick.pl -SHIPS=4 -REPS=30
0 : 0.762649480253458
...
1 3 0 2
3 1 2 0
3 1 2 0