Help for this page

Select Code to Download


  1. or download this
    C:\test>perl -E"++$h{ int( rand 65536 ) } for 1 .. 1e6; say scalar key
    +s %h; grep{ $_ & 1 } keys %h or say 'No odd numbers found'"
    32768
    No odd numbers found
    
  2. or download this
    C:\test>randperiod -M=2
    41 18467
    i:1 n:412286284
    First sequence of 2 values repeated itself after 412286284 calls to ra
    +nd
    
  3. or download this
    C:\test>randperiod -M=3
    41 18467 6334
    i:2 n:2147418117
    First sequence of 3 values repeated itself after 2147418117 calls to r
    +and
    
  4. or download this
    #! perl -slw
    use strict;
    ...
    }
    
    print "\nFirst sequence of $M values repeated itself after $n calls to
    + rand";