i need some help on this, im making a blackjack game and i need to make a stack of cards and i dont know what to do so just get me started is all im really askin for.
here is what i have so far
#include <stack>
#include <list>
#include <iostream>
#include <conio.h>
#include <string>
using namespace std;
const DECKS = 8;
enum suit { Clubs, Diamonds, Hearts, Spades};
enum value { Ace, 2, 3, 4, 5, 6, 7, 8, 9, 10, Jack, Queen, King};
/****************************************************/
class Node
{
private:
int data;
Node* next;
public:
Node();
Node(int data);
~Node(){};
Node(Node& node);
Node& operator = (Node& node);
int getData() {return data;};
Node* getNext() {return next;};
void setData(int data) { this->data = data;};
void setNext(Node* next) { this->next = next;};
};
Node::Node()
{
data = 0;
next = NULL;
}
Node::Node(int data)
{
this->data = data;
next = NULL;
}
Node::Node(Node& node)
{
this->data = node.data;
next = NULL;
}
Node& Node::operator= (Node& node)
{
this->data = node.data;
next = NULL;
return *this;
}
/**************************************************************/
/**************************************************************/
struct Card
{
stack<Card> deck;
static int counters[52 * DECKS];
int jack,
queen,
king;
int ace();
Card();
~Card();
Card (Card& card);
Card operator = (Card& card);
};
Card::Card()
{
jack = 10;
queen = 10;
king = 10;
}
int ace()
{
int choice;
cout << "do you want your Ace/s to be a 1 or an 11?" << endl;
cin >> choice;
return choice;
}
/**************************************************************/
class Player
{
private:
static int players;
int val; // sum of all the cards
public:
Player();
~Player();
Player (const Player& player);
int getSize() {return size};
};
Player::Player()
{
val = 0;
}
class Playerlist
{
private:
int size; //number of players
Player* player; // array
public:
Playerlist();
~Playerlist();
Playerlist (const Playerlist& playerlist);
int getSize() {return size;}
Player* getPlayer(int index) {return &player[index];}
};
Playerlist::Playerlist()
{
player = NULL;
cout << "How many players will be playing? " << endl;
cout << "* Number of players should not exceed the cubic dimensions * " << endl;
cin >> size;
player = new Player [size];
}
Playerlist::~Playerlist()
{
delete [] player;
}
Playerlist::Playerlist (const Playerlist& playerlist)
{
size = playerlist.size;
player = new Player [size];
for(int s = 0; s < size; s++)
player[s] = playerlist.player[s];
}
/***************************************************************/
int Player::players = 1; //static players
void main()
{
Playerlist p;
Card c;
}