in reply to Guess A Number
A side note (since the expected range of randam number is missing or i have missed it)...
my $answer = int(rand($max)) + 1;
...$answer lies in [1,$max], and w/ this...
my $answer = int(rand($max + 1));
...produces $answer in [0,$max]. (Just thinking outloud.)
Duplicate: Ah crap! The similar post above should not have been there. Please ignore that.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: Guess A Number
by sulfericacid (Deacon) on Mar 18, 2003 at 04:35 UTC |