- Everyone seems to be backing Rick up bye saying we should hav helped
more. I saw Rick get more hint than probably anyone. Usualy people get
links to a page to read for themselves, he actually got some code and
even the outright answer. If Rick is all pissed off because he didn't
read the responses to his email, and if he was confused about a response
then reply to that. It's a collaborative effort here. We don't don't
what you know Rick. We knew you know how to make a random number from
0-10, and i told you below in this forwarded message to just to a +5.
If you don't know how to do that, then reply and say, "but I don't know
how to do that". Is it possible the teacher wanted to see who in the
class already knew how to do it so he knows better where to start? Who
knows, I'm sure he has his reasons for assigning an impossible
assignment that probably only a couple in the class knew. The fact of
the matter is, we _did_ help you. If you want to be all fussy about it
because you want to be lazy, then you shouldn't be programming anyway.
Programming is about working with other people (rarely is it done by
yourself in my experience) to solve problems.
From: Bryan Irvine <bryan.irvine@...>
Subject: Re: [PBML] Random Number Generator
Date: 01 Oct 2002 08:01:02 -0700
A better solution than the one i just posted would be to set it to do
random numbers from 0-10 and do a +5 to it :-) don't know why I didn't
think of that 2 minutes ago.
On Mon, 2002-09-30 at 15:42, RicK wrote:
> Hello all,
> Just joined and new to Perl.
> Well...we were assigned a chapter exercise, where of course, one of
> the problems were not gone over in the text, or in class.
> The thing is to generate a random number. I know who to do that for
> results from 0-1, or from say 0 and 10, but when it is a differing
> range, I can't seem to figure it out.
> For this example, the number to be generated is from 5 to 15
> Here is what i have:
> #Generates a random number between various ranges
> print ("Enter Seed Number : ");
> srand (<STDIN>);
> $first = int(rand (5..15));
> print ("A\) The random number from 5 to 15 is $first \n");
> #End of program
> No matter what random seed I input, I always get "0".
> Can anyone see what the problem is? The code itself does not generate
> any errors. Is there a "between" function I can use?
> Here are the other sets of numbers I need to figure out:
> FROM -10 to 20
> FROM 300 to 305
> FROM 2 to 3
> Any help will be greatly appreciated, and I will return the favor to
> anyone anytime I can.
> Unsubscribing info is here: http://help.yahoo.com/help/us/groups/groups-32.html
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
Unsubscribing info is here: http://help.yahoo.com/help/us/groups/groups-32.html
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/