The new NodeBox forum is live! Everything from support.nodebox.net moved here: sign in with the same email to pick up your old posts. Something not working? Write to forum-support@nodebox.net.
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???
MI
MImikrubin
Okay, I just wrote my own node and used it:
import random
def evaluate(i,j):
k = random.randint(i, j)
return k
SG
SGStefan Gabriels
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.
Know something that helps?
Sign in with your email address to reply. No password needed.