hello!
I've made my first random number generator, and everytime i try it out, the numbers are random, but they all add up. so if i have a randomness range between 1 and 52 (card game) it's randomness is like this:
3, 12, 18, 25, 30, 32, 41, 49
and that is not really random i think :P
this is the source code
anyone knows whats up?Code:#include <iostream> #include <ctime> #include <cstdlib> using namespace std; int randomRange (int lowest, int highest) { return rand() % (highest - lowest) +lowest; //random number between the lowest and highest, } //including the highest (see, +lowest) int main () { srand(time(NULL)); cout << randomRange(1,52); }