Yes, we finally(!) about a year ago set the normal random by default not to always produce the same number -- this is true in the UNIX versions, I believe, but I don't know if it reached the windows side. My argument was that having the default always produce the same number was only useful in some testing situations but never in any production program. The problem here -- if you accept my random philosophy -- is that the results are too clustered.
I had a physicist friend who was about ready to present a paper with startling results (different operation system than available now and not Unicon) only to find that the random number generation was giving the same value each time. He had to withdraw his paper. From this experience, I've never trusted my off-the-top-of-my-head, post-midnight, kludges to produce a random seed adequately for a given task, assuming that I even remembered to randomize the randomizer. --Phillip On Thu, 2 Feb 2012, Jafar Al-Gharaibeh wrote: > Hi David, > > I believe &random is the seed and not to be confused with the random > sequence you would get if you use the "?" operator. &random probably gets > its initial value using the system clock with some simple math. That is why > you have numbers (seeds) that are all clustered together since probably you > ran the program several times around the same clock. If you want the same > sequence to be repeated, set &random at program start up to a specific > value, zero for example, but if you want random numbers you can do > something like > > ?x # where x is 10^6 for example to get numbers in the range of [0 : > 10^6-1 ] > # (have to double check if I got the boundaries right) > > In any case, the Unicon book seems to be inconsistent about whether the > value of &random is "randomly" set at start up or not. I believe it is. > > Jafar > > > > On Thu, Feb 2, 2012 at 3:59 PM, David Gamey <david.ga...@rogers.com> wrote: > >> Hi Folks, >> >> I know the built-in PRNG is a bit quirky and as I understand it Unicon >> departed from Icon by randomizing it initially (although UB3/Sesrit >> contradicts this). >> >> If I run this several times on Win7/x64 UniconV12: >> >> procedure main();write("&random=",&random);end >> >> I get only minor variations: >> >> &random=20122651 >> &random=20122851 >> &random=20123251 >> &random=20123351 >> &random=20123451 >> &random=20122961 >> &random=20123161 >> &random=20123261 >> &random=20123361 >> &random=20123461 >> >> Does anyone have any idea what is supposed to happen? >> >> This doesn't help much for testing (fixed &random) or for simulation >> (random &random) >> >> David >> >> >> >> >> ------------------------------------------------------------------------------ >> Keep Your Developer Skills Current with LearnDevNow! >> The most comprehensive online learning library for Microsoft developers >> is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, >> Metro Style Apps, more. Free future releases when you subscribe now! >> http://p.sf.net/sfu/learndevnow-d2d >> _______________________________________________ >> Unicon-group mailing list >> Unicon-group@lists.sourceforge.net >> https://lists.sourceforge.net/lists/listinfo/unicon-group >> >> > > > -- > "Let there be no compulsion in religion: Truth stands out clear from error" > [The Holy Qur'an 2:256] > > "Injustice anywhere is a threat to justice everywhere" Dr. King > ------------------------------------------------------------------------------ Try before you buy = See our experts in action! The most comprehensive online learning library for Microsoft developers is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, Metro Style Apps, more. Free future releases when you subscribe now! http://p.sf.net/sfu/learndevnow-dev2 _______________________________________________ Unicon-group mailing list Unicon-group@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/unicon-group