# problem of random value

• 04-11-2011, 10:03 AM
lemon
problem of random value
Hi, guys. I have a problem about random value
someone can help me?

there are some rate: rate 1 = 0.8, rate 2 = 1.2, rate 3 = 0.9;
every rate changes by a different random value between 0.5 and 1.8 per five seconds.
how to write the code?
• 04-11-2011, 10:10 AM
Dark
Um explain a little more? Are you trying to put this into a graphical interface? I don't know how you would time something without it.

Have you attempted writing this code out yet? I doubt anyone here will write the code for you.
• 04-11-2011, 12:39 PM
Dark
I'm completely lost to what this guy is talking about.
• 04-11-2011, 12:50 PM
JosAH
Quote:

Originally Posted by Dark
I'm completely lost to what this guy is talking about.

If the probability of pulling out a red marble equals 2/3 he is right; but I don't understand the context either ;-)

kind regards,

Jos
• 04-11-2011, 05:54 PM
Dark
Very unforunate spambot I think.
• 04-11-2011, 06:34 PM
ozzyman
No no, I think he just needs help writing a script to generate random numbers, with these requirements:

A) We have 3 variables with initial double values (0.8, 1.2, 0.9)
B) Alter the initial values every 5 seconds
C) The alteration should be +- random number
D) random number has the range of 0.5 to 1.8

Why he would want that is anyones guess.
• 04-11-2011, 07:05 PM
Dark
Well unless he comes to clarify his question I see no reason to try and help past what we have done so far.
• 04-11-2011, 07:11 PM
ozzyman
Yeah, that's why I didn't bother either. He went offline anyway.
• 04-11-2011, 07:15 PM
Dark
However if he meant to say what you did, the code would be rather simple to put together.