-
Notifications
You must be signed in to change notification settings - Fork 0
/
thermonuclearWar.cpp
691 lines (558 loc) · 26.5 KB
/
thermonuclearWar.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
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
//implemetation of ThermonuclearWar
#include "thermonuclearWar.h"
#include "Map.h"
#include "tictactoe.h"
#include <iostream>
#include <string>
#include <ctime>
#include <cstdlib>
#include <chrono>
using namespace std;
ThermonuclearWar :: ThermonuclearWar(){
newGame();
}
//**************************** METHODS *************************************
void ThermonuclearWar :: newGame(){
// Setting the two countries depending on who the user wants to be
char userChoice;
system("bash -c \". defcon1.sh\"");
std::this_thread::sleep_for(std::chrono::milliseconds(6000));
std::this_thread::sleep_for(std::chrono::milliseconds(1000));
system("bash -c \". screenRender.sh\"");
clearScreen();
map1.displayBoard();
system("bash -c \". screenRender.sh\"");
std::this_thread::sleep_for(std::chrono::milliseconds(150));
std::this_thread::sleep_for(std::chrono::milliseconds(750));
system("bash -c \". side.sh\"");
std::this_thread::sleep_for(std::chrono::milliseconds(150));
cout << "\nWHICH SIDE DO YOU WANT?" << endl;
std::this_thread::sleep_for(std::chrono::milliseconds(150));
cout << "\n\t1. UNITED STATES" << endl;
std::this_thread::sleep_for(std::chrono::milliseconds(150));
cout << "\t2. SOVIET UNION" << endl;
std::this_thread::sleep_for(std::chrono::milliseconds(150));
cout << "\n PLEASE CHOOSE ONE: ";
cin >> userChoice;
// ERROR CHECK
while (userChoice != '1' && userChoice != '2'){
system("bash -c \". alarm.sh\"");
std::this_thread::sleep_for(std::chrono::milliseconds(1000));
cout << "Invalid input, enter \'1\' or \'2\': ";
cin >> userChoice;
}
if (userChoice == '1'){
userCountry.setAll("United States");
cpuCountry.setAll("Soviet Union");
clearScreen();
}
else if (userChoice == '2'){
userCountry.setAll("Soviet Union");
cpuCountry.setAll("United States");
clearScreen();
}
}
void ThermonuclearWar :: runGame(){
string userSentence;
int randDamage;
int nukeDamage;
int cpuChoice;
// as long as the user has not won nor lost, keep the game running
char userChoice;
while (!didWin() && !didLose()){
// Displaying the damage for each of the countries
if (userCountry.getCountryName() == "United States"){
clearScreen();
std::this_thread::sleep_for(std::chrono::milliseconds(150));
system("bash -c \". screenRender.sh\"");
map1.displayCountry('1');
map1.displayDamageUS(userCountry.getDefenses());
map1.displayDamageUSSR(cpuCountry.getDefenses());
}
else{
clearScreen();
system("bash -c \". screenRender.sh\"");
map1.displayCountry('2');
map1.displayDamageUS(cpuCountry.getDefenses());
map1.displayDamageUSSR(userCountry.getDefenses());
}
// the damage of the missile/air strike is a random # from 100-200
srand(time(0));
randDamage = (rand() % 100) + 100;
std::this_thread::sleep_for(std::chrono::milliseconds(150));
cout << "\n*************** ATTACK OPTIONS **************\n";
std::this_thread::sleep_for(std::chrono::milliseconds(150));
cout << "Q - Send Air Strike\tW - Send Missile\nE - Try to get Nuke\n";
std::this_thread::sleep_for(std::chrono::milliseconds(150));
cout << "\n*************** SUPPLY OPTIONS **************\n";
std::this_thread::sleep_for(std::chrono::milliseconds(150));
cout << "1 - Check Supply\n";
std::this_thread::sleep_for(std::chrono::milliseconds(150));
cout << "\n*************** GAME OPTIONS **************\n";
cout << "X - Surrender/Exit\tS - Switch Game\n\nENTER: ";
cin >> userChoice;
userChoice = toupper(userChoice);
// ------- THESE ARE THE USER'S MOVES ----------
while (userChoice == '1'){
checkSupply();
cout << "\nNext Move: ";
cin >> userChoice;
userChoice = toupper(userChoice);
}
while (userChoice != 'Q' && userChoice != 'W' && userChoice != 'E' &&
userChoice != '1' && userChoice != 'X' && userChoice != 'S'){
clearScreen();
system("bash -c \". alarm.sh\"");
std::this_thread::sleep_for(std::chrono::milliseconds(1000));
cout << "Invalid! Enter Q, W, E, 1, X, or S: ";
cin >> userChoice;
userChoice = toupper(userChoice);\
}
switch (userChoice){
case 'Q':
clearScreen();
userCountry.decreaseAirStrikes();
cpuCountry.gotAttacked(randDamage);
system("bash -c \". bombers.sh\"");
std::this_thread::sleep_for(std::chrono::milliseconds(6000));
cout << "\nYOU SENT OUT AN AIR STRIKE. YOU DEALT " << randDamage;
std::this_thread::sleep_for(std::chrono::milliseconds(500));
cout << " DAMAGE.\nMY DEFENSES ARE: " << cpuCountry.getDefenses() << endl;
std::this_thread::sleep_for(std::chrono::milliseconds(3000));
displayAirStrike();
break;
case 'W':
clearScreen();
userCountry.decreaseMissiles();
cpuCountry.gotAttacked(randDamage);
system("bash -c \". authentication.sh\"");
std::this_thread::sleep_for(std::chrono::milliseconds(5000));
cout << "\nYOU SENT OUT A MISSILE. YOU DEALT " << randDamage;
std::this_thread::sleep_for(std::chrono::milliseconds(1000));
cout << " DAMAGE.\nMY DEFENSES ARE NOW " << cpuCountry.getDefenses() << endl;
displayMissile();
break;
case 'E':
clearScreen();
std::this_thread::sleep_for(std::chrono::milliseconds(150));
nukeDamage = (rand() % 100) + 300; // between 300 - 400
userCountry.setHasGottenNuke(getNuke(false));
if (userCountry.getHasGottenNuke()){
clearScreen();
std::this_thread::sleep_for(std::chrono::milliseconds(2000));
cout << "\nYOU SENT OUT A NUKE! YOU DEALT " << nukeDamage << endl;
cpuCountry.gotAttacked(nukeDamage);
std::this_thread::sleep_for(std::chrono::milliseconds(150));
cout << " DAMAGE.\nMY DEFENSES ARE: " << cpuCountry.getDefenses() << endl;
std::this_thread::sleep_for(std::chrono::milliseconds(2000));
displayNuke();
}
else
cout << "YOU FAILED AT OBTAINING A NUKE.\n\n";
std::this_thread::sleep_for(std::chrono::milliseconds(2000));
break;
case 'X':
userCountry.setHasSurrendered(true);
break;
case 'S':
cout << "WHAT GAME WOULD YOU LIKE TO PLAY?" << endl;
cin.ignore();
getline(cin, userSentence);
switchGame(userSentence);
break;
default:
system("bash -c \". alarm.sh\"");
std::this_thread::sleep_for(std::chrono::milliseconds(1000));
std::this_thread::sleep_for(std::chrono::milliseconds(150));
cout << "INVALID INPUT!" << endl;
break;
}// end user switch
// check to see if the user won, because if they did then the cpu doesn't get a turn
if (didWin() || didLose())
break;
// ------- THESE ARE THE CPU'S MOVES ------ //
randDamage = (rand() % 100) + 100;
cpuChoice = (rand() % 3) + 1;
switch (cpuChoice){
case 1:
cpuCountry.decreaseAirStrikes();
userCountry.gotAttacked(randDamage);
system("bash -c \". alarm.sh\"");
cout << "\nI SENT OUT AN AIR STRIKE. I DEALT " << randDamage;
std::this_thread::sleep_for(std::chrono::milliseconds(500));
cout << " DAMAGE.\nYOUR DEFENSES ARE: " << userCountry.getDefenses() << endl;
std::this_thread::sleep_for(std::chrono::milliseconds(8000));
displayAirStrike();
break;
case 2:
cpuCountry.decreaseMissiles();
userCountry.gotAttacked(randDamage);
system("bash -c \". alarm.sh\"");
cout << "\nI SENT OUT A MISSILE. I DEALT " << randDamage;
std::this_thread::sleep_for(std::chrono::milliseconds(150));
cout << " DAMAGE.\nYOUR DEFENSES ARE: " << userCountry.getDefenses() << endl;
std::this_thread::sleep_for(std::chrono::milliseconds(8000));
displayMissile();
break;
case 3:
std::this_thread::sleep_for(std::chrono::milliseconds(1000));
system("bash -c \". alarm.sh\"");
cout << "\n\nI ATTEMPTED TO GET A NUKE!" << endl;
nukeDamage = (rand() % 100) + 300; // between 300 - 400
std::this_thread::sleep_for(std::chrono::milliseconds(1000));
cpuCountry.setHasGottenNuke(getNuke(true));
if (cpuCountry.getHasGottenNuke()){
std::this_thread::sleep_for(std::chrono::milliseconds(1000));
system("bash -c \". alarm.sh\"");
cout << "\nI SENT OUT A NUKE! I DEALT " << nukeDamage;
std::this_thread::sleep_for(std::chrono::milliseconds(3000));
userCountry.gotAttacked(nukeDamage);
std::this_thread::sleep_for(std::chrono::milliseconds(150));
cout << " DAMAGE.\nYOUR DEFENSES ARE: " << userCountry.getDefenses() << endl;
std::this_thread::sleep_for(std::chrono::milliseconds(6000));
displayNuke();
}
else{
cout << "I FAILED AT OBTAINING THE NUKE.\n\n";
std::this_thread::sleep_for(std::chrono::milliseconds(5000));
}
break;
}//end cpu switch
}
checkEndGame();
}
bool ThermonuclearWar :: didLose(){
return (userCountry.getDefenses() == 0 ||
userCountry.getHasSurrendered() == true);
}
void ThermonuclearWar :: checkEndGame(){
char choice;
if (didWin())
{
std::this_thread::sleep_for(std::chrono::milliseconds(150));
cout << "CONGRATULATIONS!\n\n";
std::this_thread::sleep_for(std::chrono::milliseconds(1000));
system("bash -c \". winning.sh\"");
cout << " *** *** " << endl
<< " ***** ***** " << endl
<< " ***** ***** " << endl
<< " *** *** " << endl
<< " *** ***" << endl
<< " *** *** " << endl
<< " *** *** " << endl
<< " *** *** " << endl
<< " *** *** " << endl
<< " *** *** " << endl
<< " *** *** " << endl
<< " ********************** " << endl
<< " **************** " << endl;
}
else if (didLose())
{
std::this_thread::sleep_for(std::chrono::milliseconds(150));
cout << "YOU LOSE!" << endl;
std::this_thread::sleep_for(std::chrono::milliseconds(1000));
system("bash -c \". winning.sh\"");
cout << " *** *** " << endl
<< " ***** ***** " << endl
<< " ***** ***** " << endl
<< " *** *** " << endl
<< " " << endl
<< " **************** " << endl
<< " ********************** " << endl
<< " *** *** " << endl
<< " *** *** " << endl
<< " *** *** " << endl
<< " *** *** " << endl
<< " *** *** " << endl
<< " *** *** " << endl
<< " *** ***" << endl;
}
std::this_thread::sleep_for(std::chrono::milliseconds(150));
cout << "\n\nPLAY AGAIN? (Y/N)" << endl;
cin >> choice;
//ERROR CHECK
while (toupper(choice) != 'N' && toupper(choice) != 'Y'){
system("bash -c \". alarm.sh\"");
std::this_thread::sleep_for(std::chrono::milliseconds(1000));
cout << "Invalid! Enter Y or N : ";
cin >> choice;
}
if (toupper(choice) == 'Y'){
newGame();
runGame();
}
else if (toupper(choice) == 'N')
return;
return;
}
bool ThermonuclearWar :: getNuke(bool cpuChoseThis){
// this will be the random key that is generated
srand(time(0));
int randKey = (rand() % 100) + 1;
char newChar;
// this is the list of random messages that can be encrypted
string decrypted[9] = {"One minute and thirty seconds to impact.",
"Launch order confirmed.",
"People sometimes make mistakes.",
"DEFCON 1.",
"This corn is raw!",
"Hey, I don't believe that any system is totally secure.",
"Get the ICBMs in the bullpen warmed up and ready to fly.",
"What you see on these screens up here is a fantasy; a computer enhanced hallucination!",
"Have you ever heard of the word \"tumulus?\""};
// this will choose a random message from the array
int randMessage = (rand() % 9);
// Here we will store the decrypted/ encrypted messages
string encryptedMessage = "",
decryptedMessage = "";
// This is for user interface
if (!cpuChoseThis){
int numOfTries = 0,
guess;
system("bash -c \". launchCodes.sh\"");
std::this_thread::sleep_for(std::chrono::milliseconds(3000));
cout << "=============================================================" << endl
<< "YOU MUST DECRYPT A MESSAGE IN ORDER TO GAIN ACCESS TO A NUKE.\n\n";
// encrypt the randomly chosen messages with the random key
encryptMessage(decrypted[randMessage], encryptedMessage, randKey);
// HERE WE ASK THE USER TO DECRYPT THE MESSAGE
cout << "GUESS A NUMBER BETWEEN 1 AND 100 TO DECRYPT:\n";
cout << "\033[1;31m" << encryptedMessage << "\033[0m" << endl; //makes it red
while (numOfTries < 5){
cout << "GUESS: ";
cin >> guess;
//decrypt the encrypted message based on the guess
decryptMessage(decryptedMessage, encryptedMessage, guess);
cout << "DECRYPTED MESSAGE BASED ON YOUR GUESS:\n";
cout << "\033[1;34m" << decryptedMessage << "\033[0m" << endl; //makes it blue
// resetting the decrypted message
decryptedMessage = "";
if (guess > randKey){
system("bash -c \". keypad.sh\"");
std::this_thread::sleep_for(std::chrono::milliseconds(4000));
cout << "YOUR GUESS IS TOO HIGH!\n\n";
std::this_thread::sleep_for(std::chrono::milliseconds(1000));
}
else if (guess < randKey){
system("bash -c \". keypad.sh\"");
std::this_thread::sleep_for(std::chrono::milliseconds(4000));
cout << "YOUR GUESS IS TOO LOW!\n\n";
std::this_thread::sleep_for(std::chrono::milliseconds(1000));
}
if (guess == randKey){
system("bash -c \". target.sh\"");
std::this_thread::sleep_for(std::chrono::milliseconds(1000));
cout << "YOU HACKED THE MESSAGE!" << endl;
std::this_thread::sleep_for(std::chrono::milliseconds(4000));
return true;
}
numOfTries++;
}
system("bash -c \". target.sh\"");
std::this_thread::sleep_for(std::chrono::milliseconds(1000));
cout << "THE KEY WAS: " << randKey << endl;
std::this_thread::sleep_for(std::chrono::milliseconds(8000));
return false;
}
// This is for the computer's choice
else{
encryptMessage(decrypted[randMessage], encryptedMessage, randKey);
cout << "THE ENCRYPTED MESSAGE I'M TRYING TO DECRYPT:\n";
cout << "\033[1;31m" << encryptedMessage << "\033[0m\n\n";
std::this_thread::sleep_for(std::chrono::milliseconds(2000));
// the cpu guesses a random num between 1 and 100 first
int tries = 0,
maxValue = 100,
minValue = 1,
cpuGuess;
while (tries < 4){
if (tries == 0)
cpuGuess = (rand() % maxValue) + minValue;
std::this_thread::sleep_for(std::chrono::milliseconds(1000));
cout << "\n\nI GUESSED: " << cpuGuess << endl;
decryptMessage(decryptedMessage, encryptedMessage, cpuGuess);
system("bash -c \". humming.sh\"");
std::this_thread::sleep_for(std::chrono::milliseconds(2000));
cout << "DECRYPTED MESSAGE BASED ON MY GUESS: \n"
<< "\033[1;34m" << decryptedMessage << "\033[0m" << endl;
std::this_thread::sleep_for(std::chrono::milliseconds(2000));
// resetting the decrypted message
decryptedMessage = "";
if (cpuGuess > randKey){
system("bash -c \". humming.sh\"");
std::this_thread::sleep_for(std::chrono::milliseconds(2000));
cout << "MY GUESS WAS TOO HIGH!\n";
maxValue = cpuGuess;
cpuGuess = (rand() % (maxValue - minValue)) + minValue;
std::this_thread::sleep_for(std::chrono::milliseconds(2000));
}
else if (cpuGuess < randKey){
system("bash -c \". humming.sh\"");
std::this_thread::sleep_for(std::chrono::milliseconds(2000));
cout << "MY GUESS WAS TOO LOW!\n";
minValue = cpuGuess;
cpuGuess = (rand() % (maxValue - minValue)) + minValue;
std::this_thread::sleep_for(std::chrono::milliseconds(2000));
}
if (cpuGuess == randKey){
std::this_thread::sleep_for(std::chrono::milliseconds(1000));
system("bash -c \". target.sh\"");
std::this_thread::sleep_for(std::chrono::milliseconds(3000));
cout << "\nI HACKED THE MESSAGE! BY GUESSING " << cpuGuess << endl;
std::this_thread::sleep_for(std::chrono::milliseconds(3000));
return true;
}
tries++;
}
return false;
}
}
void ThermonuclearWar :: switchGame(string userSentence){
bool choseGame = false;
while (!choseGame){
removeSpacesAndCapitals(userSentence);
if (userSentence.find("tictactoe") != -1){
cout << "LAUNCHING TIC TAC TOE" << endl;
choseGame = true;
TicTacToe game1;
game1.playGame();
}
else{
cout << "I DON'T KNOW THAT GAME. THE ONLY OTHER GAME IS TICTACTOE\n";
getline(cin, userSentence);
removeSpacesAndCapitals(userSentence);
}
}
}
void ThermonuclearWar :: checkSupply(){
system("bash -c \". ratios.sh\"");
std::this_thread::sleep_for(std::chrono::milliseconds(150));
cout << "\nYOUR SUPPLIES:\n";
std::this_thread::sleep_for(std::chrono::milliseconds(150));
cout << "Air Strikes: " << userCountry.getNumAirStrikes() << endl;
std::this_thread::sleep_for(std::chrono::milliseconds(150));
cout << "Missiles: " << userCountry.getNumMissiles() << endl;
}
void ThermonuclearWar :: encryptMessage(string decryptedMessage, string &encryptedMessage, int key){
char newChar;
for (int i = 0; i < decryptedMessage.length(); i++){
if (decryptedMessage[i] + key > 126){
newChar = char(32 + decryptedMessage[i] + key - 127);
encryptedMessage+= newChar;
}
else{
newChar = char(decryptedMessage[i] + key);
encryptedMessage+= newChar;
}
}
}
void ThermonuclearWar :: decryptMessage(string &decryptedMessage, string encryptedMessage, int guess){
char newChar;
for (int i = 0; i < encryptedMessage.length(); i++){
if (encryptedMessage[i] - guess < 32){
newChar = encryptedMessage[i] + 127 - guess - 32;
decryptedMessage += newChar;
}
else{
newChar = encryptedMessage[i] - guess;
decryptedMessage += newChar;
}
}
}
void ThermonuclearWar :: displayNuke(){
system("bash -c \". explosion.sh\"");
cout << "\033[0;37m"
<< " ________________ " << endl
<< " ____/ ( ( ) ) \\___ " << endl
<< " /( ( ( ) _ )) ) )\\ " << endl
<< " (( ( )( ) ) ( ) ) " << endl
<< " ((/ ( _( ) ( _) ) ( () ) ) " << endl
<< " ( ( ( (_) (( ( ) .((_ ) . )_ " << endl
<< " ( ( ) ( ( ) ) ) . ) ( ) " << endl
<< " ( ( ( ( ) ( _ ( _) ). ) . ) ) ( ) " << endl
<< " ( ( ( ) ( ) ( )) ) _)( ) ) ) " << endl
<< " ( ( ( \\ ) ( (_ ( ) ( ) ) ) ) )) ( )" << endl
<< " ( ( ( ( (_ ( ) ( _ ) ) ( ) ) ) " << endl
<< " ( ( ( ( ( ) (_ ) ) ) _) ) _( ( )" << endl
<< " (( ( )( ( _ ) _) _(_ ( (_ ) " << endl
<< " (_((__(_(__(( ( ( | ) ) ) )_))__))_)___) " << endl
<< " ((__) \\\\||lll|l||/// \\_)) " << endl
<< " ( /(/ ( ) ) )\\ ) " << endl
<< " ( ( ( ( | | ) ) )\\ ) " << endl
<< " ( /(| / ( )) ) ) )) ) " << endl
<< " ( ( ((((_(|)_))))) ) " << endl
<< " ( ||\\(|(|)|/|| ) " << endl
<< " ( |(||(||)|||| ) " << endl
<< " ( //|/l|||)|\\\\ \\ ) " << endl
<< " (/ / // /|//||||\\\\ \\ \\ \\ _) " << endl
<< "\033[0m";
std::this_thread::sleep_for(std::chrono::milliseconds(3000));
}
void ThermonuclearWar :: displayMissile(){
system("bash -c \". missile.sh\"");
std::this_thread::sleep_for(std::chrono::milliseconds(150));
cout << "\033[1;32m"
<< " ,: \n"
<< " ,' | \n"
<< " / : \n"
<< " --' / \n"
<< " \\/ />/ \n"
<< " / <//_\\ \n"
<< " __/ / \n"
<< " )'-. / \n"
<< " ./ :\\ \n"
<< " /.' ' \n"
<< " '/' \n"
<< "\033[0m";
cout << "\033[1;33m"
<< " + \n"
<< " ' \n"
<< " `. \n"
<< "\033[0m";
cout << "\033[0;37m"
<< " .-\"- \n"
<< " ( | \n"
<< " . .-' '. \n"
<< " ( (. )8: \n"
<< " .' / (_ ) \n"
<< " _. :(. )8P ` \n"
<< "\033[0m";
}
void ThermonuclearWar :: displayAirStrike(){
system("bash -c \". bomberPlane.sh\"");
std::this_thread::sleep_for(std::chrono::milliseconds(150));
cout << "\033[1;36m"
<< " _____ ______ \n"
<< " | : \\ | \\ \n"
<< " | : `\\______|______\\_______ \n"
<< " \\'______ \\_____\\_____ \n"
<< " \\____/-)_,---------,_____________>-- \n"
<< " \\ / \n"
<< " | / \n"
<< " |____/__ \n"
<< " \n"
<< "\033[0m";
cout << " |\\**/| \n"
<< " \\ == / \n"
<< " | | \n"
<< " | | \n"
<< " \\ / \n"
<< " \\/ \n";
}
void removeSpacesAndCapitals(string &sentence){
for (int i = 0; i < sentence.length(); i++){
if (isspace(sentence[i])){
sentence.erase(i,1);
i--;
}
else if (isupper(sentence[i]))
sentence[i] = tolower(sentence[i]);
}
}
void clearScreen()
{
int n;
for (n = 0; n < 10; n++)
printf( "\n\n\n\n\n\n\n\n\n\n" );
}