Random values always the same
Blitz3D Forums/Blitz3D Beginners Area/Random values always the same
| ||
Well, this is strange but, i've noticed for some time now, That Rand() Command returns always the same results.. for instance, if you write, for x = 1 to 10 : Text 1,1, rand(1,10): Next , It will write 10 different numbers.... the tricky thing is that if you run the program again, the 10 numbers will be the same!! over and over....each time you run, no matter how many times you do it, it's always the same numbers.. how can I get real random numbers? this is the first time I see something like this on a programming language!!! |
| ||
SeedRnd MilliSecs() |
| ||
yeah, or if you want uber-random stuff, do something like Seedrnd (Millisecs()/45*100+73/5) =D |
| ||
chwaga...that seams to be an illegal type conversion |
| ||
i think he was just trying to make a point. are you seeding the rand function w/ seernd? |
| ||
yeah ok whatever, thanks anyway. |
| ||
mr. slat, that seems like you spelled "seems" incorrectly. take that! |
| ||
LOL |
| ||
besides, I tried doing it and got no illegal type conversion when i used that, look at this!SeedRnd (MilliSecs/83*50+30*93-2/50) Graphics 1280, 1024, 32, 1 LockBuffer FrontBuffer() Repeat WritePixelFast Rnd(2, 1278), Rnd(2, 1022), Rnd(0, 10000) Until KeyHit(1) End |
| ||
Seedrnd (Millisecs()/45*100+73/5) That won't make your random number generation anymore random, anyway. SeedRnd(Millisecs()) is as good as it gets. |
| ||
shut up and let me have my fun |