Here's another way. From addons/stats/base/random.ijs
NB. =========================================================
NB.*randomize v sets a random value into random link
randomize=: 3 : 0
try.
require 'guid'
tmp=. _2 (3!:4) , guids 1
catch. NB. general/misc/guid.ijs not available
tmp=. >:<.0.8*0 60 60 24 31#.0 0 0 0 _1+|.<.}.6!:0 ''
end.
([ 9!:1) {.^:(2~:9!:42'') tmp NB. set random initial random seed
)
-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Linda Alvord
Sent: Friday, November 28, 2014 21:03
To: [email protected]
Subject: Re: [Jprogramming] Get unique results each time you use deal and
roll
This agrees with {Pascal's answer. I thought you could take some number of
seconds in the time and find the last digits or something and then roll that
number and then begin your code. Maybe I isn't possible.
Linda
-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of tom arneson
Sent: Friday, November 28, 2014 9:16 PM
To: [email protected]
Subject: Re: [Jprogramming] Get unique results each time you use deal and
roll
Try this, from: http://www.jsoftware.com/jwiki/JPhrases/RandomNumbers
m3=: 9!:1@<.@(+/ .^&2@(6!:0@])) NB.Randomizing random number seed
-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Linda Alvord
Sent: Friday, November 28, 2014 19:01
To: [email protected]
Subject: [Jprogramming] Get unique results each time you use deal and roll
7?7
1 4 5 0 6 2 3
10?10
5 1 3 2 4 0 7 8 6 9
Now run the code again after closing J and you get the same results. How
can you get different results each time. I vaguely rember using some date or
other number with roll to insure different results.
Linda
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm