A computer cannot generate random on its own, so it does it based of the time. here is a random number generator without using the random block. Note: n1 must be smaller then n2