ei dudes, im kinda havin' a hard time getting random nos. for the battleship game im workn' on.
well, my prob goes like this.
i rand a number then i add up some nos. to the initial no so it would look like the nos are inter connected, when i rand the next nos. i get some chances that they have the some contradiction between the nos.(which i could not afford)
please hope you could reply as soon as possible... Really need help.. SOS.
I had to read the post five times before I understood what you meant. I recommend that you keep writing like that if your objective is to irate programmers. We are the worst kind of grammar nazis there is.
Simply use an std::set to store past numbers and check their existence after getting each, and get another one if it already exists.
Seed the PRNG just once, and if you want randomer numbers, don't seed it with a constant.