Ok now it work. thank you very much dear sir!
I will adapt it to seed multiple scenarios of variables.
Posted 17 August 2015 - 02:38 AM
Nice. Got there in the end!
Bump maps are the new auto-tune ![]()
VPX - RSS Updates ---- blog.flippingflips.xyz/en/ -- Visual Pinball No.1 (2021) . Est.2000
Posted 17 August 2015 - 04:04 AM
You all do it realy wrong way (and not efective).
Sure. Wrong that it's a simple working function? The effective / faster comment I can take, but you'd be best posting that kind of reply on the blog it came from originally and not to blind leading blind. http://blogs.technet...g-a-script.aspx
All that methods are wrong, beqace they waste time. If you want generate 10 numbers, they are "ok". But if more, they may create a lot of troubles. They work like this:
guess number,
check if number was used
not used -> done
used -> retry
So if you guess number in range from 1 to 1000 and it is last try it will (statisticaly):
try too guess number 1000 times just to find that last one number not used.
check every guess (1000) with table of previous guesses, So it will be 1000 compare operations => a lot of lost time
Only in one case that algorythm is ok: if you need small number of values in big rang, like you need 10 random unique values in range 1 .. 10000.
My version for every number will do:
- 1 guess (call rnd function)
- 1 swap operation.
Allways.
@Steve:
Link to test table with we usage cases:
http://www.ravarcade.pl/debug/test.fpt
Edited by ravarcade, 17 August 2015 - 04:05 AM.
BAM page: http://www.ravarcade.pl
current BAM version: v1.5-317, released: Oct 11, 2020
Posted 17 August 2015 - 04:20 AM
All that methods are wrong, beqace they waste time.
And that's why I pretty much said... it would be better to tell those guys and post there what you have posted here. Then the next time this happens they could use your function.
Bump maps are the new auto-tune ![]()
VPX - RSS Updates ---- blog.flippingflips.xyz/en/ -- Visual Pinball No.1 (2021) . Est.2000