1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
|
#include "card_games.h"
#include <iostream>
using std::cin;
using std::cout;
using std::endl;
card StudPoker::deckFuncion () {
srand(time(0));
struct card deck[52]; // An array of cards named deck, size 52
const string ranks[ ] = { "Ace", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight",
"Nine", "Ten", "Jack", "Queen", "King" };
const string suits[ ] = { "Diamonds", "Hearts", "Spades", "Clubs" };
int k = 0;
for ( int i = 0; i < 13; i++)
{
for ( int j = 0; j < 4; j++)
{
deck[ k ].rank = ranks[ i ];
deck[ k ].suit = suits[ j ];
k++;
}
}
return (card);
};
|