in reply to Re: Slightly Srandom JAPH
in thread Slightly Srandom JAPH
The integer overflow error you got seems very surprising, since I would expect srand JAPH to be the same thing as srand "JAPH", which should be the same thing as srand 0.
On the other hand... I know that my code is dependent on perl having specific implementations of srand, rand, and sort, so if you run it, and it prints out an apparently random shuffling of the letters of HnlcrhJsre_Pt_aeAeuot_, then I wouldn't be surprised.
The version of perl I tested it against was 5.16.0, so I would expect that version of perl to produce the right output.
To create your own (admittedly version specific) JAPH based on this, you can do it the way I did.This time, this was done with 5.12.1.perl -e 'print length "just another perl hacker"' 24 perl -e 'my $x = ("a".."z")[23]; print $x' x perl -e 'srand 42; print sort {4-rand 9} ("a".."x")' gnkhwqpiejbaxdlcrfomtsuv perl -e '$_ = join "", "a".."x"; y/gnkhwqpiejbaxdlcrfomtsuv/Just_anoth +er_Perl_hacker/' rerPt_Jtohseauhnalkcer__ perl -e 'srand 42; print sort {4-rand 9} split //, rerPt_Jtohseauhnalk +cer__' Just_another_Perl_hacker
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: Slightly Srandom JAPH
by Athanasius (Archbishop) on Dec 28, 2013 at 08:01 UTC | |
by Tux (Canon) on Dec 30, 2013 at 08:32 UTC |