How to create a function, which on every call generates a random integer number? This number must be most random as possible (according to uniform distribution). It is only
Here's a function with uniform distribution over the entire range of int:
int rand() { static int random = 0; return random++; }