Re: Signature
Ivan Popovski <[email protected]>
| Newsgroups | gmane.network.slrn.user |
|---|---|
| Message-ID | <[email protected]> |
On Sat, Feb 23, 2008 at 06:30:46AM +1000, Troy Piggins wrote:
> private variable Random;
> define srandom (r)
> {
> Random = r;
> }
> srandom (_time() * getpid());
> define random ()
> {
> Random = (Random*69069U + 1013904243U)&0xFFFFFFFFU;
> return Random;
> }
> % end pseudo-random function
> #v-
>
> Then in your function, use it like this
>
> #v+
> define your_function()
> {
>
> ...
> % returns random number between 0 and 999
> variable rnd= random() mod 1000;
> ...
>
> }
Nice ty :)
Anyway maybe i could write slang script that will do all the job :)
and i guess that should be faster ;)
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/