Just to avoid any possible confusion - the essay I linked to uses J's built-in 
random number generators too. It just provides cover verbs to facilitate 
storing and resetting multiple instances of the seed (& optionally RNG 
implementation) within a single session.

If you just want a way to produce some predictable "random" dummy data for 
something, then Roger's suggestion to use ?. is going to be the simplest 
solution.

> From: Devon McCormick
> 
> Or you could use the built-in RNG:
> 
>    ]cs=. 9!:0 ''  NB. Current seed
> 16807
>    10?10000
> 8590 8623 7940 9267 6558 6272 8741 8793 3555 7335
> 
>    9!:1]cs        NB. Reset seed
> 
>    10?10000
> 8590 8623 7940 9267 6558 6272 8741 8793 3555 7335
> 
> 
> On Mon, Apr 26, 2010 at 10:49 PM, Sherlock, Ric
> <[email protected]>wrote:
> 
> > > From: Carl Wyant
> > >
> > > I would like to be able to generate a 'list' of 'random' (or I
> guess,
> > > pseudo-random), non-repeating numbers; somewhere between 00000 and
> > > 99999.
> > > But more importantly, I would like to be able to repeat, [or
> > > alternatively,
> > > have someone else (on some other computer)] generate the SAME list.
> > >
> > > Is there some way to do this in J, short of creating a formula to
> just
> > > 'randomize' such a list?
> > >
> >
> > Yes this is possible. See the following Wiki page for
> implementations:
> >
> > http://www.jsoftware.com/jwiki/Essays/RNG
> >
> > ---------------------------------------------------------------------
> -
> > For information about J forums see
> http://www.jsoftware.com/forums.htm
> >
> 
> 
> 
> --
> Devon McCormick, CFA
> ^me^ at acm.
> org is my
> preferred e-mail
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to