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 37 38 39 40
|
// Blackjack
#include <iostream>
#include <stack>
#include <string>
#include <vector>
#include <cstdlib>
#include <fstream>
#include <ctime>
using namespace std;
string suit[4] = { "CLUBS", "DIAMONDS", "HEARTS", "SPADES" };
string value[13] = { "ACE", "TWO", "THREE", "FOUR", "FIVE", "SIX", "SEVEN", "EIGHT", "NINE", "TEN", "JACK", "QUEEN", "KING" };
struct Card {
int value, suit;
Card(int value, int suit);
string toString();
};
class Deck{
public:
stack<Card> deck;
void addCard(Card c) { deck.push(c); }
};
int main(){
Deck deck;
for(int i = 0; i < 13; i++){
for(int j = 0; j < 4; j++){
Card card(i, j);
deck.addCard(card);
}
}
return 0;
}
|