in reply to Re: Perl script newbie need help !!!
in thread Perl script newbie need help !!!

took 0 tries to get a 6
I've got a tournament backgammon match on Monday. If you can tell me how to get some sixes without throwing the dice, I'd be ever so grateful.

Yours not very sincerely, :-)

John Davies

Replies are listed 'Best First'.
Re^3: Perl script newbie need help !!!
by Marshall (Canon) on Nov 12, 2010 at 05:01 UTC
    Ha, a off by error! was ok for histo, but not $count. The general idea of how to do it remains the same as well as comments on imperfections in the standard rand() function. the link I provided is a good starting place.

    good luck in your backgammon match!

Re^3: Perl script newbie need help !!!
by aquarium (Curate) on Nov 12, 2010 at 04:46 UTC
    all the numbers have already occured. the visual display is just proof that they occured in a particular sequence.
    mathematical true randomness can never be reached, as you would need an infinitely large set (number of dice throws.)
    in real life a dice can actually land on edge, and also any number of factors can introduce a bias. a program/script to generate dice throws or such, is a limited model.
    if this is indeed some kind of dice throwing pretend problem, it should clearly define the limits/assumptions. as the required output for this excercise can change quite a bit depending on these assumptions.
    the hardest line to type correctly is: stty erase ^H