Noob here. Thanks in advance for any help, and I hope this is articulate enough to make the question clear.
I need to generate random values for a few variables. And then, if those values meet certain characteristics, I need to trash them and re-generate (re-define the value of the variable?).
I probably need to do this with a function but I'm just learning those and not sure how to escape the "locality" of variables created in a function (I'll need to call them later in the script).
So let's say I have:
x = rand(1...9)
y = rand(1...9)
z = rand(1...9)
Afterward I need something like
if x - y - z < 0
then **start over** until x - y - z > 0
end
It seems like this must have a "simple" solution that I just don't have the experience/knowledge to see. Any ideas appreciated!
Aucun commentaire:
Enregistrer un commentaire