Re: Random number generators (was: RE: [AD] Allegro 4.2 todos)

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


Charles Wardlaw wrote:

> Now, since one of Allegro's big features is out-of-the-box portability
> of programs written using it across so many platforms, I would think
> that having a public allegro_random() or rand_ex() function would go
> towards making a port homogeneous, as the same random numbers could be
> gotten on all platforms and all compilers.

I agree on the portability being very important, however it was
mentioned before that you have to be careful with random: if the
implementation changes people's programs might break because of
different random series. Also, for that reason the internal random
call in the blender can't use a public random function, as it might
screw up the users series, without the user realizing it.

I think the current situation is best: put a simple, _hidden_ rng in
the library for the blender, and let the examples use the system
rand. This way the alrand addon can remain the portable way to provide
random numbers to allegro programmers, with a choice of decent RNG's
and reproducable results for those that need it.

Hein Zelle

>-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-< 
 Unix is user friendly. It's just very particular about who 
 it's friends are.

 Hein Zelle                     hein@xxxxxxxxxx
	                        http://www.icce.rug.nl/~hein
>-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-<




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/