-
Notifications
You must be signed in to change notification settings - Fork 0
/
Map.cpp
235 lines (220 loc) · 13.6 KB
/
Map.cpp
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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
// Implementation for class Map
#include "Map.h"
#include <thread>
#include <chrono>
#include <iostream>
#include <cstdlib>
using namespace std;
Map::Map()
{
player = '1';
}// Map constructor
Map::Map(char player)
{
this->player = player;
} // overloader constructor
void Map::displayBoard()
{
cout << "\n" << endl;
std::this_thread::sleep_for(std::chrono::milliseconds(150));
cout << " 7:::7" <<" :::::\n";
std::this_thread::sleep_for(std::chrono::milliseconds(150));
cout << " 7:::777:::77:::77 " <<" :::::\n";
std::this_thread::sleep_for(std::chrono::milliseconds(150));
cout << " 7:::?7+777:::777::7I7?7 7777" <<" ::: :: ::::::: :\n";
std::this_thread::sleep_for(std::chrono::milliseconds(150));
cout << " ?7777:::77:77:::77:::7I77 77?77" <<" ::::+::::: : ::: :::::::::: ::\n";
std::this_thread::sleep_for(std::chrono::milliseconds(150));
cout << " 77:::7?7777:::77:77:::7 77 7777" <<" ::::::::::::::: ::::::::::::::::::: ::\n";
std::this_thread::sleep_for(std::chrono::milliseconds(150));
cout << " I777:::777:77:::777::777:::77+?" <<" :::::::::::::::: :::::::::::::::::\n";
std::this_thread::sleep_for(std::chrono::milliseconds(150));
cout << " 777:::77::777:::7+77:77+??7::7" <<" ::::++:+::::::::::::::::::::::::\n";
std::this_thread::sleep_for(std::chrono::milliseconds(150));
cout << " 777:::77::77+I777+777?777?7777" <<" ::+::++:::::::::::::::::::::::: :\n";
std::this_thread::sleep_for(std::chrono::milliseconds(150));
cout << " 77:::777:::7777777I7+?77777" <<" :::::::::::::::::::::::::::::::::::\n";
std::this_thread::sleep_for(std::chrono::milliseconds(150));
cout << " ?77+77::77:7777:::77:77" <<" :::::::::::::::::::::::::::::::::::\n";
std::this_thread::sleep_for(std::chrono::milliseconds(150));
cout << " 7777:::777:::777" <<" :: :::::::::::::::::::::::: :\n";
std::this_thread::sleep_for(std::chrono::milliseconds(150));
cout << " 7I 7:::+ 777 7" <<" :::::::::::::: ::: :\n";
std::this_thread::sleep_for(std::chrono::milliseconds(150));
cout << " 7I I7" <<" ::::::::::::::\n";
std::this_thread::sleep_for(std::chrono::milliseconds(150));
cout << " :::::::::\n";
std::this_thread::sleep_for(std::chrono::milliseconds(150));
cout << " :::::::\n";
std::this_thread::sleep_for(std::chrono::milliseconds(150));
cout << "\n\t UNITED STATES SOVIET UNION\n" << endl;
}// end displayBoard
void Map::displayCountry(char player)
{
if(player == '1') // If they want to be the US
{
cout << "\n" << endl;
std::this_thread::sleep_for(std::chrono::milliseconds(150));
cout << "\033[1;31m 7:::7\033[0m" <<" :::::\n";
std::this_thread::sleep_for(std::chrono::milliseconds(150));
cout << "\033[1;31m 7:::777:::77:::77 77\033[0m" <<" :::::\n";
std::this_thread::sleep_for(std::chrono::milliseconds(150));
cout << "\033[1;31m 7:::?7+777:::777::7I7?7 7777\033[0m" <<" ::: :: ::::::: :\n";
std::this_thread::sleep_for(std::chrono::milliseconds(150));
cout << "\033[1;31m ?7777:::77:77:::77:::7I77 77?77\033[0m" <<" ::::+::::: : ::: :::::::::: ::\n";
std::this_thread::sleep_for(std::chrono::milliseconds(150));
cout << "\033[1;31m 77:::7?7777:::77:77:::7 77 7777+\033[0m" <<" ::::::::::::::: ::::::::::::::::::: ::\n";
std::this_thread::sleep_for(std::chrono::milliseconds(150));
cout << "\033[1;31m I777:::777:77:::777::777:::77+?\033[0m" <<" :::::::::::::::: :::::::::::::::::\n";
std::this_thread::sleep_for(std::chrono::milliseconds(150));
cout << "\033[1;31m 777:::77::777:::7+77:77+??7::7\033[0m" <<" ::::++:+::::::::::::::::::::::::\n";
std::this_thread::sleep_for(std::chrono::milliseconds(150));
cout << "\033[1;31m 777:::77::77+I777+777?777?7777\033[0m" <<" ::+::++:::::::::::::::::::::::: :\n";
std::this_thread::sleep_for(std::chrono::milliseconds(150));
cout << "\033[1;31m 77:::777:::7777777I7+?77777\033[0m" <<" :::::::::::::::::::::::::::::::::::\n";
std::this_thread::sleep_for(std::chrono::milliseconds(150));
cout << "\033[1;31m ?77+77::77:7777:::77:77+\033[0m" <<" :::::::::::::::::::::::::::::::::::\n";
std::this_thread::sleep_for(std::chrono::milliseconds(150));
cout << "\033[1;31m 7777:::777:::777+\033[0m" <<" :: :::::::::::::::::::::::: :\n";
std::this_thread::sleep_for(std::chrono::milliseconds(150));
cout << "\033[1;31m 7I 7:::+ 777 7+\033[0m" <<" :::::::::::::: ::: :\n";
std::this_thread::sleep_for(std::chrono::milliseconds(150));
cout << "\033[1;31m 7I I7\033[0m" <<" ::::::::::::::\n";
std::this_thread::sleep_for(std::chrono::milliseconds(150));
cout << " :::::::::\n";
std::this_thread::sleep_for(std::chrono::milliseconds(150));
cout << " :::::::\n";
cout << "\n" << endl;
}
else // if they want to be Soviet Union
{
cout << "\n" << endl;
std::this_thread::sleep_for(std::chrono::milliseconds(150));
cout << " 7:::7" <<"\033[1;31m :::::\033[0m\n";
std::this_thread::sleep_for(std::chrono::milliseconds(150));
cout << " 7:::777:::77:::77 " <<"\033[1;31m :::::\033[0m\n";
std::this_thread::sleep_for(std::chrono::milliseconds(150));
cout << " 7:::?7+777:::777::7I7?7 7777" <<"\033[1;31m ::: :: ::::::: :\033[0m\n";
std::this_thread::sleep_for(std::chrono::milliseconds(150));
cout << " ?7777:::77:77:::77:::7I77 77?77" <<"\033[1;31m ::::+::::: : ::: :::::::::: ::\033[0m\n";
std::this_thread::sleep_for(std::chrono::milliseconds(150));
cout << " 77:::7?7777:::77:77:::7 77 7777" <<"\033[1;31m ::::::::::::::: ::::::::::::::::::: ::\033[0m\n";
std::this_thread::sleep_for(std::chrono::milliseconds(150));
cout << " I777:::777:77:::777::777:::77+?" <<"\033[1;31m :::::::::::::::: :::::::::::::::::\033[0m\n";
std::this_thread::sleep_for(std::chrono::milliseconds(150));
cout << " 777:::77::777:::7+77:77+??7::7" <<"\033[1;31m ::::++:+::::::::::::::::::::::::\033[0m\n";
std::this_thread::sleep_for(std::chrono::milliseconds(150));
cout << " 777:::77::77+I777+777?777?7777" <<"\033[1;31m ::+::++:::::::::::::::::::::::: :\033[0m\n";
std::this_thread::sleep_for(std::chrono::milliseconds(150));
cout << " 77:::777:::7777777I7+?77777" <<"\033[1;31m :::::::::::::::::::::::::::::::::::\033[0m\n";
std::this_thread::sleep_for(std::chrono::milliseconds(150));
cout << " ?77+77::77:7777:::77:77" <<"\033[1;31m :::::::::::::::::::::::::::::::::::\033[0m\n";
std::this_thread::sleep_for(std::chrono::milliseconds(150));
cout << " 7777:::777:::777" <<"\033[1;31m :: :::::::::::::::::::::::: :\033[0m\n";
std::this_thread::sleep_for(std::chrono::milliseconds(150));
cout << " 7I 7:::+ 777 7" <<"\033[1;31m :::::::::::::: ::: :\033[0m\n";
std::this_thread::sleep_for(std::chrono::milliseconds(150));
cout << " 7I I7" <<"\033[1;31m ::::::::::::::\033[0m\n";
std::this_thread::sleep_for(std::chrono::milliseconds(150));
cout << "\033[1;31m :::::::::\033[0m\n";
std::this_thread::sleep_for(std::chrono::milliseconds(150));
cout << "\033[1;31m :::::::\033[0m\n";
cout << "\n" << endl;
}
}// End chooseCountry
void Map::displayDamageUS(int damage)
{
if(damage <= 1000 && damage > 800)//damage values can be easily changed. For now I am just testing
{
std::this_thread::sleep_for(std::chrono::milliseconds(150));
cout << "-----------------------------------------------------------"<< endl;
std::this_thread::sleep_for(std::chrono::milliseconds(150));
cout << "USA:" << "\033[1;33m #####################################################\033[0m" << "|\n"; // yellow
std::this_thread::sleep_for(std::chrono::milliseconds(150));
cout << "-----------------------------------------------------------"<< endl;
}
if(damage <= 800 && damage > 600)
{
std::this_thread::sleep_for(std::chrono::milliseconds(150));
cout << "-----------------------------------------------------------"<< endl;
std::this_thread::sleep_for(std::chrono::milliseconds(150));
cout << "USA:" << "\033[1;32m #########################################\033[0m" << " |\n"; // green
std::this_thread::sleep_for(std::chrono::milliseconds(150));
cout << "-----------------------------------------------------------"<< endl;
}
if(damage <= 600 && damage > 400)
{
std::this_thread::sleep_for(std::chrono::milliseconds(150));
cout << "-----------------------------------------------------------"<< endl;
std::this_thread::sleep_for(std::chrono::milliseconds(150));
cout << "USA:" << "\033[1;34m ##############################\033[0m" << " |\n"; // blue
std::this_thread::sleep_for(std::chrono::milliseconds(150));
cout << "-----------------------------------------------------------"<< endl;
}
if(damage <= 400 && damage > 200)
{
std::this_thread::sleep_for(std::chrono::milliseconds(150));
cout << "-----------------------------------------------------------"<< endl;
std::this_thread::sleep_for(std::chrono::milliseconds(150));
cout << "USA:" << "\033[1;35m #################\033[0m" << " |\n"; // magenta
std::this_thread::sleep_for(std::chrono::milliseconds(150));
cout << "-----------------------------------------------------------"<< endl;
}
if(damage <= 200 && damage >= 0)
{
std::this_thread::sleep_for(std::chrono::milliseconds(150));
cout << "-----------------------------------------------------------"<< endl;
std::this_thread::sleep_for(std::chrono::milliseconds(150));
cout << "USA:" << "\033[1;31m ######\033[0m" << " |\n"; // red
std::this_thread::sleep_for(std::chrono::milliseconds(150));
cout << "-----------------------------------------------------------"<< endl;
}
}
void Map::displayDamageUSSR(int damage)
{
if(damage <= 1000 && damage > 800)//damage values can be easily changed. For now I am just testing
{
std::this_thread::sleep_for(std::chrono::milliseconds(150));
cout << "-----------------------------------------------------------"<< endl;
std::this_thread::sleep_for(std::chrono::milliseconds(150));
cout << "USSR:" << "\033[1;33m ###################################################\033[0m" << "|\n"; // yellow
std::this_thread::sleep_for(std::chrono::milliseconds(150));
cout << "-----------------------------------------------------------"<< endl;
}
if(damage <= 800 && damage > 600)
{
std::this_thread::sleep_for(std::chrono::milliseconds(150));
cout << "-----------------------------------------------------------"<< endl;
std::this_thread::sleep_for(std::chrono::milliseconds(150));
cout << "USSR:" << "\033[1;32m #########################################\033[0m" << " |\n"; // green
std::this_thread::sleep_for(std::chrono::milliseconds(150));
cout << "-----------------------------------------------------------"<< endl;
}
if(damage <= 600 && damage > 400)
{
std::this_thread::sleep_for(std::chrono::milliseconds(150));
cout << "-----------------------------------------------------------"<< endl;
std::this_thread::sleep_for(std::chrono::milliseconds(150));
cout << "USSR:" << "\033[1;34m ##############################\033[0m" << " |\n"; // blue
std::this_thread::sleep_for(std::chrono::milliseconds(150));
cout << "-----------------------------------------------------------"<< endl;
}
if(damage <= 400 && damage > 200)
{
std::this_thread::sleep_for(std::chrono::milliseconds(150));
cout << "-----------------------------------------------------------"<< endl;
std::this_thread::sleep_for(std::chrono::milliseconds(150));
cout << "USSR:" << "\033[1;35m #################\033[0m" << " |\n"; // magenta
std::this_thread::sleep_for(std::chrono::milliseconds(150));
cout << "-----------------------------------------------------------"<< endl;
}
if(damage <= 200 && damage >= 0)
{
std::this_thread::sleep_for(std::chrono::milliseconds(150));
cout << "-----------------------------------------------------------"<< endl;
std::this_thread::sleep_for(std::chrono::milliseconds(150));
cout << "USSR:" << "\033[1;31m ######\033[0m" << " |\n"; // red
std::this_thread::sleep_for(std::chrono::milliseconds(150));
cout << "-----------------------------------------------------------"<< endl;
}
}