Repository navigation
Expand file tree
/
Copy pathCard.cpp
More file actions
131 lines (123 loc) · 1.98 KB
/
Copy pathCard.cpp
File metadata and controls
131 lines (123 loc) · 1.98 KB
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
#include "Card.h"
#include <iostream>
using namespace std;
//Blue
int Blue::getCardsPerCoin(int coins) {
switch (coins) {
case 1: return 4;
case 2: return 6;
case 3: return 8;
case 4: return 10;
}
}
string Blue::getName() {
return "Blue";
}
void Blue::print(ostream& out) {
out << "B";
}
//Chili
int Chili::getCardsPerCoin(int coins) {
switch (coins) {
case 1: return 3;
case 2: return 6;
case 3: return 8;
case 4: return 9;
}
}
string Chili::getName() {
return "Chili";
}
void Chili::print(ostream& out) {
out << "C";
}
//Stink
int Stink::getCardsPerCoin(int coins) {
switch (coins) {
case 1: return 3;
case 2: return 5;
case 3: return 7;
case 4: return 8;
}
}
string Stink::getName() {
return "stink";
}
void Stink::print(ostream& out) {
out << "S";
}
//Green
int Green::getCardsPerCoin(int coins) {
switch (coins) {
case 1: return 3;
case 2: return 5;
case 3: return 6;
case 4: return 7;
}
}
string Green::getName() {
return "Green";
}
void Green::print(ostream& out) {
out << "G";
}
//soy
int soy::getCardsPerCoin(int coins) {
switch (coins) {
case 1: return 2;
case 2: return 4;
case 3: return 6;
case 4: return 7;
}
}
string soy::getName() {
return "soy";
}
void soy::print(ostream& out) {
out << "s";
}
//black
int black::getCardsPerCoin(int coins) {
switch (coins) {
case 1: return 2;
case 2: return 4;
case 3: return 5;
case 4: return 6;
}
}
string black::getName() {
return "black";
}
void black::print(ostream& out) {
out << "b";
}
//Red
int Red::getCardsPerCoin(int coins) {
switch (coins) {
case 1: return 2;
case 2: return 3;
case 3: return 4;
case 4: return 5;
}
}
string Red::getName() {
return "Red";
}
void Red::print(ostream& out) {
out << "R";
}
//garden
int garden::getCardsPerCoin(int coins) {
switch (coins) {
case 1: throw Card::IllegalChain(); return 0;
case 2: return 2;
case 3: return 3;
case 4: throw Card::IllegalChain(); return 0;
}
}
string garden::getName() {
return "garden";
}
void garden::print(ostream& out) {
out << "g";
}