-
Iteration?
Hey
Say that I wanted to create a random number on call, is that possible?
By this I mean that if I need a random number can I call a function without writing the entire, seed .. modulo, etc. ?
Secondly can you iterate this function and set each iteration to a varible?
E.g.
I have a random number code,
But I want to set 10 varibles with random numbers?
-
The simple way is to write a wrapper function for the standard random number functions, and have that function do the seeding only the first time it is called. You can also do a similar thing for any third-party pseudo-random number generators.
You don't need to iterate a function: simply call it multiple times in a loop, and assign its return value to some variable.
-
I see, well Ill research into it and try and find how to do it as im pretty basic atm.
Thanks for the heads up.