   random numbers
  I want to add some randomness to my program to make the movement more realistic.But I can't seem to find what I want to do on the net anywhere so can anyone here help?What I want to do is have 3 random numbers generated between 0.1 and 0.2, and 3 random numbers between -0.01 and -0.02. Then for these numbers to continually cahnge between these values.I'm sure this is possible as it should be quite simple but I an't seem to work it out. Can anyone give me a hand?Thanks   
  If you want to want more realistic movement, maybe you can use 1d perlin noise?Check out this tutorial, on the bottom of the page some applications are mentioned, 1D perlin noise might be want you want. Here and here is some more info.   ;  To generate a random floating-point number between two values (inclusive), you can use this function:float rand_float( float a, float b )    {   return float( rand() ) / float( RAND_MAX ) * ( a - b ) + b;    } So to generate your random numbers, you would use the function like this:a[0] = rand_float( 0.1f, 0.2f );    a[1] = rand_float( 0.1f, 0.2f );    a[2] = rand_float( 0.1f, 0.2f );    b[0] = rand_float( -0.01f, -0.02f );    b[1] = rand_float( -0.01f, -0.02f );    b[2] = rand_float( -0.01f, -0.02f ); Look up the standard library functions rand() and srand() for more information.What do you mean by "continually change"? If you are more specific about what it means, then the solution might become apparent.   ;  Thanks I that's helped a lotPerlin noise looked good, but a bit over the top for what I want.By continually change I ment, that it generates a random number then I use this number in some arthimetic, but then for it to loop back round and give me another random number and so on so the the position of the object continually changes.But that's sorted now, thanks for all your help   