Charles Lu wrote:
If I want to randomly generate a dice (4 side) roll, I can use the
following expression:
$roll = 1 + int( rand(4));
This assumes that every side of this dice has equal chance of being
rolled (0.25). Thats easy. Now What if I say, that the probability of
rolling a 3 is 70
Charles Lu <[EMAIL PROTECTED]> wrote:
:
: If I want to randomly generate a dice (4 side) roll, I can use
: the following expression:
:
: $roll = 1 + int( rand(4));
:
: This assumes that every side of this dice has equal chance of
: being rolled (0.25). Thats easy. Now What if I say, that th
On Jan 24, 2004, at 3:31 PM, Charles Lu wrote:
$probability = { '1' => 0.1,
'2' => 0.1,
'3' => 0.7,
'4 => 0.1
}
What if you did it the other way around?
my $probability= {0 => 1, 1 => 2, 9 => 4};
On Jan 24, 2004, at 5:31 PM, Charles Lu wrote:
Hi
If I want to randomly generate a dice (4 side) roll, I can use the
following expression:
$roll = 1 + int( rand(4));
This assumes that every side of this dice has equal chance of being
rolled (0.25). Thats easy. Now What if I say, that th
Hi
If I want to randomly generate a dice (4 side) roll, I can use the
following expression:
$roll = 1 + int( rand(4));
This assumes that every side of this dice has equal chance of being rolled
(0.25). Thats easy. Now What if I say, that the probability of rolling a 3
is 70% and the pro