|
Post by u9 on Feb 22, 2007 15:09:11 GMT -5
It would be nice if it would be possible to fix the seed of math.getRndInt and Math.getRndReal (and maybe even Math.getRndNormal). In VB script if you supply a negative value to rnd() it sets that value as the seed for the next time you call rnd(). This is great for debugging and would be nice if that could be implemented into the Math object's random generators also. Of course, not the worlds biggest problem, but right now I need to generate some random numbers (for the cities in my traveling salesman algorithm) and during debugging i really need to have the random numbers fixed to see if any changes i make in my algorithm have the desired effect. So I had to substitute math.getrndint(0,screen_width) with the good old rnd()*screen_width
|
|
|
Post by Guilect on Feb 22, 2007 18:02:32 GMT -5
How about
Math.GetRndInt(low, high, [optional fixed])
p.s. in the v1.7 beta, GetRndInt is not functioning, it got broke in swapping the high and low value positions. It has been fixed and will be in the official release of v1.7.
|
|
|
Post by u9 on Feb 22, 2007 20:33:39 GMT -5
How about Math.GetRndInt(low, high, [optional fixed]) Yeah, it could be good. Basically what i do now is include a rnd(-1) at the top of my code which sets the seed for the next number and then it is always the same from there one. So that means i only call rnd with a negative parameter once. Anyways, don't go to too much trouble though
|
|