-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
56 lines (55 loc) · 2.24 KB
/
Copy pathmain.cpp
File metadata and controls
56 lines (55 loc) · 2.24 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
#include <iostream>
#include <FL/Fl.H>
#include <FL/Fl_Window.H>
#include "include/GameGUI/GameGUI.h"
int main(int argc, char *argv[]) {
std::cout << "Input Y to use default settings, or n to decline:" << std::endl;
std::string is_default;
std::cin >> is_default;
if (is_default == "Y") {
GameGUI *game = new GameGUI({1, 3, 6, 2, 5, 4}, {1, 3, 6, 2, 5, 4});
game->start();
} else {
std::cout << "Please enter the layout of red chess pieces from top to bottom, left to right: " << std::endl;
std::vector<int> red_chess;
std::vector<bool> red_check = {false, false, false, false, false, false};
for (int i = 0; i < 6; i++) {
int temp;
std::cin >> temp;
if (temp >= 1 && temp <= 6 && !red_check[temp]) {
std::cout << "Red piece " << temp << " verification passed" << std::endl;
red_chess.push_back(temp);
red_check[temp] = true;
} else {
std::cout << "Red piece " << temp << " verification failed" << std::endl;
i--;
}
}
std::cout << "Final input for red pieces: " << std::endl;
for (auto chess : red_chess) {
std::cout << chess << " ";
}
std::cout << std::endl;
std::cout << "Please enter the layout of blue chess pieces from from bottom to top, right to left: "<< std::endl;
std::vector<int> blue_chess;
std::vector<bool> blue_check = {false, false, false, false, false, false};
for (int i = 0; i < 6; i++) {
int temp;
std::cin >> temp;
if (temp >= 1 && temp <= 6 && !blue_check[temp]) {
std::cout << "Blue piece " << temp << " verification passed" << std::endl;
blue_chess.push_back(temp);
blue_check[temp] = true;
} else {
std::cout << "Blue piece " << temp << " verification failed" << std::endl;
i--;
}
}
std::cout << "Final input for blue pieces: " << std::endl;
for (auto chess : blue_chess) {
std::cout << chess << " ";
}
auto *game = new GameGUI(red_chess, blue_chess);
game->start();
}
}