Linda, Run m3 and it sets the seed of the random number generator (RNG) to new values based on the time. Do this before you start to generate random numbers. With a new seed you'll get a different sequence of RNs.
-----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
