Page 1 of Random numbers
PCs & Mobiles Forum
Anybody know where I can down load a Random number generator which will let me specify limits.
I want to generate numbers between 1 and 659 initially, but will need to expand the range upwards later
Thanks in advance
Steve Harris
If you download a free GNU C++ compiler, it is very simple to write one - literally a handful of lines of code by including the C++ standard library and using the rand() function. That`s all there is to it!
This item was edited on Monday, 20th March 2006, 21:42
Again in Java is a random class with a method that can do that for you just write a very simple program and your off. If you are really strugguling to do it PM me and I will get a little method do do it for you.
You need to download SDK though.
The C route is much easier and quicker, don`t forget to seed the random number generator too as it they are not really random - just algorithms.
Yep, that`s why I suggested Gnu C++ compiler as it`s a small download but if Steve already has a compiler then it`s basically take your pick.
I understand about the seeding as there is no such thing as a computed random number.
This is easily done in Excel with the RAND function and a little bit of logic.
multiply the RAND output by 10000 to get a number between 0 and 10000.
Then an IF statement to give the limits, and a tiny macro to auto calc until the value falls between the limits.