in reply to check my logic & a random number issue
One way to approach this is to strip out everything extraneous. This bisects the problem. If the symptoms go away, you have a pretty good idea which side of the line the problem lies on.
Something like the following may help you gain some insight:
Does this produce results consistent with what you're seeing?use Math::Random; for ( 1 .. 100 ) { my $d1 = random_uniform_integer(1,1,6); my $d2 = random_uniform_integer(1,1,6); print $d1 + $2, "\n"; }
Is also helps, when asking people to review your code, to indent. Unindented code is hard to read, and many people will take one look at it and walk away.
Oh, and use strict; to avoid accidental globals like $roll.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: check my logic & a random number issue
by rmckillen (Novice) on Oct 11, 2002 at 03:15 UTC |