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
|
class card {
public:
unsigned char r;
unsigned char s;
bool state;
friend class player;
};
class player{
public:
int a[11];
int setSuma(){
for(int i = 1; i <= 11; i++){
if(a[i] == 11 || a[i] == 12 || a[i] == 13){
suma += a[i]+1;
} else if(a[i] == 1) {
suma += 11;
}else {
suma += a[i];
}
}
return suma;
}
void showSum();
private:
int suma;
};
card deck[52] = {
{ ACE, SPD }, { 2, SPD }, { 3, SPD }, { 4, SPD }, { 5, SPD }, { 6, SPD }, { 7, SPD },
{ 8, SPD }, { 9, SPD }, { 10, SPD }, { JACK, SPD }, { QUEEN, SPD }, { KING, SPD },
{ 1, HRT }, { 2, HRT }, { 3, HRT }, { 4, HRT }, { 5, HRT }, { 6, HRT }, { 7, HRT },
{ 8, HRT }, { 9, HRT }, { 10, HRT }, { JACK, HRT }, { QUEEN, HRT }, { KING, HRT },
{ 1, DIA }, { 2, DIA }, { 3, DIA }, { 4, DIA }, { 5, DIA }, { 6, DIA }, { 7, DIA },
{ 8, DIA }, { 9, DIA }, { 10, DIA }, { JACK, DIA }, { QUEEN, DIA }, { KING, DIA },
{ 1, CLB }, { 2, CLB }, { 3, CLB }, { 4, CLB }, { 5, CLB }, { 6, CLB }, { 7, CLB },
{ 8, CLB }, { 9, CLB }, { 10, CLB }, { JACK, CLB }, { QUEEN, CLB }, { KING, CLB }
};
|