- or download this
sub pick_one
{
...
return $i if(rand(1) <= 1/($to-$i+1));
}
}
- or download this
sub pick_n
{
...
}
return @picked;
}
- or download this
my(@counts);
...
{
print "Count[$c] = $counts[$c]\n";
}
- or download this
Count[0] =
Count[1] = 29974
...
Count[8] = 30092
Count[9] = 29830
Count[10] = 30028