Did you roll your own shuffle, because List::Util has shuffle, which may very well be faster/more random for your shuffling.
The weighted draw has come up a few times over the years (I was looking at this b/c of some Secret Santa stuff I was doing and my mind wondered) - check out Efficiently selecting a random, weighted element. Since you are doing an exhaustive search, I'd think the small amount of processor time spent on spinning with your next is much cheaper than a histogram based solution would be (weight*rand). In any case, never forget Amdahl's Law: a little time spent improving that I/O will always do wonders.
When can I start losing hours of my life to Space Wars?
In reply to Re: Rolling For Initiative
by kennethk
in thread Rolling For Initiative
by SuicideJunkie
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |