1. Pseudo random binary number gen

I need a PN binary number gen that when it is given a set of numbers it
generate's another set and vis-versa...Does any one have one?

J Reeves
Grape Vine
ICQ# 13728824

______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com

new topic     » topic index » view message » categorize

2. Re: Pseudo random binary number gen

Let me get this straight.  You want a generator that when a
set of numbers are given to the generator, the generator gives
a different set of numbers.  And when that different set of
numbers are given to the generator, the original set comes back
out of the generator.

        Lucius L. Hilley III
        lhilley at cdc.net
+----------+--------------+--------------+
| Hollow   | ICQ: 9638898 | AIM: LLHIII  |
|  Horse   +--------------+--------------+
| Software | http://www.cdc.net/~lhilley |
+----------+-----------------------------+


> ---------------------- Information from the mail
header -----------------------
> Sender:       Euphoria Programming for MS-DOS
<EUPHORIA at LISTSERV.MUOHIO.EDU>
> Poster:       Grape_ Vine_ <g__vine at HOTMAIL.COM>
> Subject:      Pseudo random binary number gen
> --------------------------------------------------------------------------
-----
>
> I need a PN binary number gen that when it is given a set of numbers it
> generate's another set and vis-versa...Does any one have one?
>
> J Reeves
> Grape Vine
> ICQ# 13728824
>
> ______________________________________________________
> Get Your Private, Free Email at http://www.hotmail.com
>

new topic     » goto parent     » topic index » view message » categorize

3. Re: Pseudo random binary number gen

I've got a pseudo rnd number generator wich I wrote a while back for some
assembly projects I was doing. I don't know if this is what you're looking
for, but here it is anyway..


--<CODE>
sequence random64
integer seed1,seed2


--64 32-bit random numbers for use with the rnd number generator.
--I don't remember where I got these numbers from, probably from
--some old demo.. oh well.
random64={
342098742,397843269,234983498,986538974
}

seed1=29
seed2=63


function Rand(integer range)
atom crap
crap=random64[seed1+1]
crap+=random64[seed2+1]
random64[seed2+1]=crap
seed1+=1
seed1=and_bits(seed1,63)
seed2+=1
seed2=and_bits(seed2,63)
return remainder(crap,range)
end function



--test function
for i=1 to 20 do
printf(1,"Rand(300) = %d\n",Rand(300))
end for

--</CODE>

______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com

new topic     » goto parent     » topic index » view message » categorize

4. Re: Pseudo random binary number gen

yeah,
pnrnd() produces

5,6,4,5,76,232,64,54,6,232,4,56,32,32,5,55,4,4
and the sequence we want is 232,64,54,6
it returns 123(seed) and 6(offset)

then we can feed 123,6 to it(on another computer) and it will give
232,64,54,6,232,4,56,32,32,5,55,4,4

It need to return only one number every time it is called..thats how i a
geting rid of needing a length of the returned sequence...

>From: "Lucius L. Hilley III" <lhilley at CDC.NET>
>Reply-To: Euphoria Programming for MS-DOS <EUPHORIA at LISTSERV.MUOHIO.EDU>
>To: EUPHORIA at LISTSERV.MUOHIO.EDU
>Subject: Re: Pseudo random binary number gen
>Date: Thu, 23 Dec 1999 09:57:48 -0500
>
>     Let me get this straight.  You want a generator that when a
>set of numbers are given to the generator, the generator gives
>a different set of numbers.  And when that different set of
>numbers are given to the generator, the original set comes back
>out of the generator.
>
>         Lucius L. Hilley III
>         lhilley at cdc.net
>+----------+--------------+--------------+
>| Hollow   | ICQ: 9638898 | AIM: LLHIII  |
>|  Horse   +--------------+--------------+
>| Software | http://www.cdc.net/~lhilley |
>+----------+-----------------------------+
>
______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com

new topic     » goto parent     » topic index » view message » categorize

5. Re: Pseudo random binary number gen

Yes this is what i am after...1000 Thanx

>From: stab master <stabmaster_ at HOTMAIL.COM>
>Reply-To: Euphoria Programming for MS-DOS <EUPHORIA at LISTSERV.MUOHIO.EDU>
>To: EUPHORIA at LISTSERV.MUOHIO.EDU
>Subject: Re: Pseudo random binary number gen
>Date: Thu, 23 Dec 1999 14:22:52 PST
>
>I've got a pseudo rnd number generator wich I wrote a while back for some
>assembly projects I was doing. I don't know if this is what you're looking
>for, but here it is anyway..
>
>
>--<CODE>
>sequence random64
>integer seed1,seed2
>
>
>--64 32-bit random numbers for use with the rnd number generator.
>--I don't remember where I got these numbers from, probably from
>--some old demo.. oh well.
>random64={
>342098742,397843269,234983498,986538974
>}
>
>seed1=29
>seed2=63
>
>
>function Rand(integer range)
>atom crap
>crap=random64[seed1+1]
>crap+=random64[seed2+1]
>random64[seed2+1]=crap
>seed1+=1
>seed1=and_bits(seed1,63)
>seed2+=1
>seed2=and_bits(seed2,63)
>return remainder(crap,range)
>end function
>
>
>
>--test function
>for i=1 to 20 do
>printf(1,"Rand(300) = %d\n",Rand(300))
>end for
>
>--</CODE>
>
>______________________________________________________
>Get Your Private, Free Email at http://www.hotmail.com

______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu