Hello Juho!

% perl -le 'for (1..1e5) { $i = 0; $a[$i++][$_]++ for sort { rand 2 }
1..8}; print "@{$_}" for @a'

 12388 12645 12681 12492 12367 12426 12539 12462
 25237 24897 12483 12611 9295 9275 3081 3121
 17130 17292 20329 20314 7103 6986 5517 5329
 18181 17940 22611 22762 3489 3505 5750 5762
 9069 9183 9548 9577 14932 14751 16482 16458
 9041 8952 7308 7259 24383 24325 9287 9445
 5052 5152 8430 8513 13539 13842 22739 22733
 3902 3939 6610 6472 14892 14890 24605 24690

But:

% perl -le '@_=(1..8); for (1..1e5) {$i=0; $a[$i++][$_]++ for
@_=sort{rand [EMAIL PROTECTED] print "@{$_}" for @a'

 12303 12509 12602 12374 12652 12534 12404 12622
 12382 12465 12617 12681 12479 12598 12420 12358
 12477 12517 12453 12416 12629 12547 12397 12564
 12571 12423 12551 12401 12543 12515 12650 12346
 12571 12472 12350 12537 12496 12529 12515 12530
 12460 12553 12475 12667 12567 12373 12321 12584
 12496 12582 12450 12602 12325 12392 12752 12401
 12740 12479 12502 12322 12309 12512 12541 12595

I don't really understand why @_=sort{rand [EMAIL PROTECTED] would seem
to be more randomly distributed. When I was testing this
I thought it may be platform dependent. Would we see the
above differences on every machine?

-Riley
(o0lit3)

Reply via email to