> > I get allways (10 times at least) the same result:
> > -------------------------------------------------------------
> > \starttext
> > \startluacode
> > math.randomseed(os.time())
> > \stopluacode
> >
> > Encode your Name and Surname as a
> > \startluacode
> > local a = {'null-terminated', 'dollar-terminated', 'Pascal'}
> > context('%s string', a[math.random(1,3)])
> > \stopluacode
> > \stoptext
> > -------------------------------------------------------------
> > How can I randomize this?
> 
> Hmm... which version are you using?  I do get a ranom output each
> time.
> Tested with 2009.12.31 and  2010.03.20.

This is LuaTeX, Version beta-0.60.0-2010040521 (rev 3596) 
 \write18 enabled.
(tst-b.tex

ConTeXt  ver: 2010.03.30 18:56 MKIV  fmt: 2010.4.7  int: 
english/english
 
> Since the math seed is set after \starttext, it should overwrite the
> value after reading the tuc file.
> 
> Actually, I consider saving the random number in tuc file to be a 
> misfeature. A random sequence generator should generate a random
> sequence. 
> If I want the same behavior all the time, I can use 
> \setupsystem[random=12345] (which should also set 
> math.randomseed).

I agree with this!
A feature could be to save the last used random value in the tuc, so 
that one can continue with the former used sequenz. But this should 
not be used automatically, too. May be one should than say

\setupsystem[random=last]

Wolfgang

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

Reply via email to