I am trying to generate 9 random numbers that do not repeat. here is the code I am using.
srand(
unsigned(time(NULL)));
int x=0;
vector <int> Num_Array;
for(int i=1; i<=9; i++)
{
Num_Array.push_back(i);
}
random_shuffle(Num_Array.begin(),Num_Array.end());
player_O=Num_Array[x];
x++;
I am attempting to do some AI for a tic tac toe game.