-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcard.hpp
49 lines (42 loc) · 889 Bytes
/
card.hpp
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
41
42
43
44
45
46
47
48
49
#include <iostream>
using namespace std;
class Card {
private:
int number;
char ace;
public:
void setNumber(int x) {
number = x;
}
int getNumber() {
return number;
}
void dealCard() {
int val = (rand()%13) + 1;
switch(val) {
case 11:
case 12:
case 13: number=10; break;
default: number=val;
}
}
void aceSwitch(bool up) {
if(up) number=11;
else number=1;
}
};
/*
class Deck{
private: Card cards[52];
public:
Deck();
void getCard();
};
Deck::Deck(){
for(int i=1;i<=13;i++){
for(int j=0;j<4;j++){
cards[j*i+j].setNumber(i);
cout<<cards[j*i+j].getNumber()<<"\n";
}
}
}*/