Truly Random Number?
I need to generate a truly random number between 1 and 250. It appears the only way I can do this is by changing the seed. I could use RANDOM to change the seed, but you begin to see the problem...?
How can I generate a truly random number using Nodebox 3? What am I missing???
Comments are currently closed for this discussion. You can start a new one.
Keyboard shortcuts
Generic
? | Show this help |
---|---|
ESC | Blurs the current field |
Comment Form
r | Focus the comment reply box |
---|---|
^ + ↩ | Submit the comment |
You can use Command ⌘
instead of Control ^
on Mac
1 Posted by Mike Rubin on 02 Jun, 2014 06:33 PM
Okay, I just wrote my own node and used it:
import random
def evaluate(i,j):
k = random.randint(i, j)
return k
Support Staff 2 Posted by Stefan Gabriels on 03 Jun, 2014 08:42 AM
There is no such thing as a true random number. We use a seed so that the same results can be reproduced later on, if we need it. Suppose you created a nice procedural graphic with random numbers but forgot to save it. Without a seed it could never be recreated again and lost forever. The closest thing to true randomization (if that's what you want) is to attach something like the current time to the seed parameter, but right now we don't have time nodes in nodebox yet (we will have them soon though). You could also try to roll your own in python.
Stefan Gabriels closed this discussion on 03 Jun, 2014 08:42 AM.