(int)((double)rand() / ((double)RAND_MAX + 1) * N)
I don't even really understand what that means, but I am afraid to ask because I will be told to search for it on google instead of getting an explanation and I will get flamed for all eternity and excommunicated by the persons on the board.