[NTG-context] random background picture in metafun

Hans Hagen pragma at wxs.nl
Thu Mar 15 19:06:00 CET 2012


On 15-3-2012 10:18, Thomas A. Schmitz wrote:
> 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...

Ah, but keep in mind that the random number is stored in the tuc file! 
So, as long as that file is not wiped, you get the same random number 
initialization. Imagine what would happen if we would not do that. So, 
just erase the tuc if you want another seed.

Hans

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------


More information about the ntg-context mailing list