I want integers 1-52 to be drawn only once, so every "card" will be seen and not one picked twice, heres the code
#include<iostream>
#include<time.h>
#include<string>
#include<stdlib.h>
using namespace std;
class Player{
int hand;
};
int main()
{
srand(time(NULL));
int deck=53;
int *drawn;
int notdraw[52];
for (int n=1;n<53;n++)
{
deck-=1;
drawn = new int;
*drawn = rand() % 52+1;
for (int i = 0; i <n; i++)
{
while(*drawn==notdraw[i])
{
delete drawn;
drawn = new int;
*drawn = rand() % 52+1;
}
}
cout << deck << ". " << *drawn << endl;
notdraw[n]= *drawn;
delete drawn;
}
cout << deck << endl;
system("PAUSE");
}
Ignore the class, Ill be messing with it later