有人知道Activeperl是否使用Windows 'stdlib‘作为rand和srand函数吗?我使用的是perl 5.16。提前感谢您的回复。
发布于 2013-01-18 00:10:52
my $s = 4071;
my $rnd = sub {return (($s = ($s * 214013 + 2531011) % 2 ** 31) >> 16 )};
foreach(0..51){print $rnd->()," "}
print "\n";
srand(4071);
foreach(0..51){print rand()*2**15," "}
print "\n";Deal_cards_for_FreeCell#Perl
https://stackoverflow.com/questions/14176032
复制相似问题