// thanks to DRobbins at katazeev
#include <iostream>
#include <cstdlib>
#include <string>
#include <time.h>
using namespace std;
int main()
{
//char myLyne[100];
//cin.getline(myLyne,100);
string cardsuits[4] = { "Spades", "Hearts", "Diamonds", "Clubs" };
string cardfacesvalues[13] = { "2", "3", "4", "5", "6", "7", "8", "9", "10", "Jack", "Queen", "King", "Ace" };
int deck [52];
int index;
int newIndex;
int holdVal;
int crdsuit;
int crdval;
int holdIndex;
int playerdecks[2][52];
int playerdptr[2]={0,0};
int playerrecoverys[2][52];
int playerdrptr[2]={0,0};
int playerindex;
srand ( time(NULL) );
for(index=0; index <= 51; index++)
{ deck[index]=index; }
for(index=0; index <= 51; index++)
{ newIndex = rand() % 52;
holdVal = deck[newIndex];
deck[newIndex] = deck[index];
deck[index] = holdVal;
}
for(index=0; index <= 51; index++)
{ crdsuit=deck[index]/13;
crdval=deck[index]%13;
cout << "Card in Deck is: Index #" << index << ", Card # " << deck[index] << ", a " << cardfacesvalues[crdval] << " of " << cardsuits[crdsuit] << ", worth " << crdval << "\n";
}
index=0;
for(playerindex=0; playerindex <= 1; playerindex++)
{ for(newIndex=0; newIndex <= 25; newIndex++)
{ playerdecks[playerindex][newIndex] = deck[index];
cout << "index: " << index << ", playerindex: " << playerindex << ", newIndex: " << newIndex << ", Val: " << playerdecks[playerindex][newIndex] << "\n";
index++;
}
playerdptr[playerindex]=26;
}
char myLine[100];
cin.getline(myLine,100);
return 0;
}