[NTG-context] randomize

Wolfgang Werners-Lucchini wwl at musensturm.de
Thu Apr 8 09:28:14 CEST 2010


> > I know this and I have triggerd this by hand. So there is a lot of
> > time between. I have purged files between every run and I got the
> > same result if I wait 1 second, 1 minute or 1 day.
> 
>   Well, then it probably qualifies as a bug, and, since the .tuc
> file
> has apparently been dismissed as a cause,  you'd have to provide
> more
> precise information if you're interested in having it corrected (or
> do the debugging yourself, of course).
> 
> 	Arthur

I have found a discussion on this thema. See

http://lua-users.org/lists/lua-l/2007-03/msg00564.html

So I have changed the example to

-------------------------------------------------------------
\starttext
\startluacode
math.randomseed(os.time())
_=math.random()
\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
-------------------------------------------------------------

and this is working ok!

Wolfgang


More information about the ntg-context mailing list