All pastes #271919 Raw Edit

Mine

public text v1 · immutable
·published 2006-12-08 15:34 UTC
rendered paste body
#include <iostream>
#include <string>
#include <list>

using namespace std;

class Card {
private:
	int value;
	int suit;
public:
	Card(int, int);
	void show();
};

Card::Card(int v, int s) {
	value = v;
	suit = s;
}

void Card::show() {
	char suitChar;
	switch (suit) {
		case 0:
			suitChar = 'S';
			break;
		case 1:
			suitChar = 'C';
			break;
		case 2:
			suitChar = 'D';
			break;
		case 3:
			suitChar = 'H';
			break;
		default:
			cout << "what";
	}
	cout << "ze card is " << suitChar << " " << value;		
}

class Pile {
	list<Card> cards;
	char name[100];
public:
	Pile(char *);
	Pile(char *, int);
	//void addCard(Card * c);
	void Pile::show();
	Card * draw();
};

Pile::Pile(char * n) {
	strncpy(name, n, 100);
	list<Card*> cards;
}

Pile::Pile(char * n, int t) {
	list<Card*> cards;
	strncpy(name, n, 100);
	for(int s=0; s<4; s++) {
		for(int v=1; v<14; v++) {
			Card * tmpc = new Card(v,s);
			cards.push_back(tmpc);
			cout << "what " << v << " " << s << "\n";
		}
	}
}

/*void Pile::addCard(Card * c) {
	cards.push_back(c);
}*/

void Pile::show() {
}

@@Card * Pile::draw() {
@@	return cards.pop_back();
@@}

int main (int argc, char * const argv[]) {
	Pile deck("cock",69);
	/*Card * card1 = deck.draw();
    card1->show();*/
	return 0;
}