Help for this page

Select Code to Download


  1. or download this
    $ perl -e '
        my $iters = 100_000;
    ...
            print "\n";
        }
    '
    
  2. or download this
    perl -e 'my $iters = 100_000; my $runs = 6; for my $sides (qw{1 2 3 4 
    +6 8 10 20 100}) { printf "%-5s", "D$sides:"; for (1 .. $runs) { my $t
    +ot = 0; for (1 .. $iters) { $tot += int(rand $sides)+1; } print " ", 
    +$tot/$iters; } print "\n"; } '
    
  3. or download this
    D1:   1 1 1 1 1 1
    D2:   1.49943 1.5049 1.49996 1.49833 1.50001 1.50155
    ...
    D10:  5.4949 5.48275 5.50242 5.50131 5.49563 5.51278
    D20:  10.47763 10.47848 10.50873 10.48685 10.48474 10.51209
    D100: 50.36542 50.49534 50.49152 50.40469 50.53791 50.34646