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 35 36
|
#include <iostream>
#include <string>
const int number_of_cards = 52;
void shuffle(int list[], int size) {
srand(time(0));
for (int i = 0; i < size; i++) {
int index = rand() % number_of_cards;
int temp = list[i];
list[i] = list[index];
list[index] = temp;
}
}
int main() {
using namespace std;
int deck[number_of_cards];
string suits[] = {"Clubs", "Diamonds", "Hearts", "Spades"};
string ranks[] = {"Ace", "2", "3", "4", "5", "6", "7", "8", "9", "10", "Jack" "Queen", "King"};
//int value[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13};
//for(int i = 0; i < number_of_cards; i++)
//deck[i] = i;
//shuffle(deck, number_of_cards);
for (int x = 0; x < 13; x++) {
for (int i = 0; i < 4; i++) {
cout << ranks[x] << " of " << suits[i] << endl;
}
cout << endl;
}
return 0;
}
|