-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMythic.cpp
89 lines (63 loc) · 1.87 KB
/
Mythic.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
//
// Mythic.cpp
// Cards
//
// Created by Sisir Potluri on 6/5/20.
// Copyright © 2020 Sisir Potluri. All rights reserved.
//
#include <iostream>
#include <fstream>
#include <cassert>
#include <cstring>
#include <string>
#include <array>
#include <vector>
#include <sstream>
#include <algorithm>
#include "Battle.h"
using namespace std;
int main () {
int num_players = 0;
string player1;
string player1_type;
string player2;
string player2_type;
int num_wars;
cout << "How many players will play (up to 2)? The rest will be computer-generated bots." << endl;
cin >> num_players;
while(!(num_players == 0 || num_players == 1 || num_players == 2)) {
cout << "A maximum of 2 players can play, please enter a valid number of players." << endl;
cin >> num_players;
}
if (num_players == 0) {
player1 = "BOT1";
player1_type = "Bot";
player2 = "BOT2";
player2_type = "Bot";
}
else if (num_players == 1) {
cout << "Please enter your name." << endl;
cin >> player1;
player1_type = "Real";
player2 = "BOT";
player2_type = "Bot";
}
else {
cout << "Please enter one player's name." << endl;
cin >> player1;
cout << "Please enter the other player's name." << endl;
cin >> player2;
player1_type = "Real";
player2_type = "Real";
}
cout << "How many battles must be won to decide the winner of the war?" << endl;
cin >> num_wars;
vector<string> data;
data.push_back(player1);
data.push_back(player1_type);
data.push_back(player2);
data.push_back(player2_type);
Battle main_battle(data, num_wars);
main_battle.play_game();
return 0;
}