Original Post
I''m a little bit confused about this. This is what I''ve been doing.
If you say getRandom(5), you always get numbers 0 <= y < 5, but they repeat themselves in a really small pattern, like 0 3 4 1 0 3 4 1 0 3 4 1...
How can I make this pattern larger?
int getRandom(int m) {
static int x = time(0);
int a = 2;
int b = 3;
x = (a * x + b) % m;
return x;
}