On 03/13/2012 07:24 PM, Peter Rolf wrote:
Actually, round (uniformdeviate(nopics-1)) does not give equal weightage
>  to 1 and nofpics. A better solution is
>
>  n:= floor(uniformdeviate(nofpics)) + 1;
>
:-)

I used 'floor' in my prior tests, but changed it to 'round' because of
the very small chance of getting the highest number (at least with my
formula).

Let's hope, nobody has wikified my bad maths;-)


>  which gives a uniform weight to all numbers.

Hmm, I absolutely stink at math, but after a few days of testing: the "randomness" is a bit disappointing. All my presentations start more or less with the same set of background pictures, and since most have < 22 slides, some slides never come up in the rotation. Is there a way to provide metafun with a random seed, say the decimal digit of pi corresponding to the rounded number of my cpu's temperature (just kidding)? Or maybe a lua solution would be nice, metafun seems to be a bit to conservative in its choice of random numbers...

Thomas
___________________________________________________________________________________
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