Hey everyone, I got bored and decided I wanted to make a 'pitch' cards game in c++, however I came across the problem of generating all 52 cards in a deck without duplicating the same card.
So basically, I just want to print out every single card in the deck without duplicating anything. Here is what I have so far:
#include<iostream>
#include<time.h>
using namespace std;
int main()
{
int number[52], suit[52];
char suitname[4][25] = {"Hearts", "Diamonds", "Clubs", "Spades"}, numbername[13][25] = {"2","3","4","5","6","7","8","9","10","Jack","Queen","King","Ace"};
srand ((unsigned)time(0));
for(int x=0;x<52;x++)
{
number[x] = (rand()%13);
suit[x] = (rand()%4);
cout << "You picked a " << numbername[number[x]] << " of " << suitname[suit[x]] << "!\n\n";
}
}