I need to get a series of random numbers which are alldifferant to each other, in a given range. However i need my script to return the same series of random numbers given the same information passed from a form.<br>
Thanks
The form passes the day, month, year, a lucky number and a lucky word, so on a given day the user should be able to enter the same word and number and get the same random numbers.<br>
Thanks
Ok. Look in the perlfunc man page for the srand function - this starts off the perl random number generator at a certain point.<br>
<br>
Think of the date as a number like this: 19993108<br>
<br>
and a word as a series of numbers - the ascii value of those characters - add all these values together.<br>
<br>
Add the date number to the value you got from adding the ascii values of the lucky word (and your lucky number) and use that result to initialise (to "seed" - they call it) the random number generator.<br>
<br>
That should give you a starting point.<br>
<br>
Interesting. People normally want to know how make thier "random" series of numbers *truly* random - much more difficult.<br>
<br>
Regards<br>
<br>
Mike<br>
---<br>
Mike_Lacey@Cargill.Com<br>
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.