So I have an assignment which requires me to create a random number generator with some specifics. I have to use "double r = (((double) rand() / (double) RANDMAX) (max - min)) + min ;"as my number generator, which is fine, but I have to do it using a vector, and as I have gone through 90% or more of the vector I have to reshuffle and start from the beginning. I can generate random numbers just fine with a vector, but can't get it to work with this prescribed code, and I have no idea how you look to see that you've hit 90% of all possible numbers. I've been working on this for a couple weeks now and I am just lost. The sad part is that the assignment isn't really about the random numbers, its showing I can slap all of into a class, which is actually the easy part, but since I had a long break (several years), between the first class and this new one, I tend to struggle with the easy stuff. Can anyone help walk me through this?
- Hot
- Active
-
How To: Add texture to 3D objects with OpenGL for C++
-
How To: Draw text with OpenGL in Microsoft Visual C++
-
How To: Create a spinning 3D cube with OpenGL, GLUT and C++
-
How To: Create a fog effect when creating an OpenGL program in MS Visual C++
-
How To: Create basic 3D shapes using OpenGL and GLUT for C++
-
How To: Store text in an array when programming in C++
-
How To: Add lighting to 3D scenes with OpenGL for C++
-
How To: Build advanced arrays when coding in the C++ programming language
-
How To: Add colors to 3D scenes with OpenGL for C++
-
How To: Use namespace std when writing code in C++
-
How To: Simulate transparent objects with alpha blending in Microsoft Visual C++
-
How To: Use void functions with C++
-
How To: Set up OpenGL and GLUT on Linux for C++
-
How To: Make a Celsius to Fahrenheit converter in C++
-
How To: Design a game with C++
-
How To: Say 'hello world' in C++
-
How To: Program a random number generator in C++
-
How To: Set up OpenGL and GLUT on Windows for Visual C++
-
How To: Create a Socket in the C Programming Language under Unix
-
How To: Use the string class when programming in C++
Be the First to Respond
Share Your Thoughts