]>
Commit | Line | Data |
---|---|---|
f8656e40 | 1 | #include <fstream> |
2 | #include <iostream> | |
3 | ||
4 | using std::cerr; | |
5 | using std::cout; | |
6 | using std::ofstream; | |
7 | ||
8 | char menu(); | |
9 | ||
10 | int main() | |
11 | { | |
12 | ofstream outfile; | |
13 | ||
14 | outfile.open("options.h"); | |
15 | if (outfile.fail()) | |
16 | { | |
17 | cerr << "Error opening options.h" << endl; | |
18 | return 1; | |
19 | } | |
20 | char c = 0; | |
21 | ||
22 | do { | |
23 | c = menu(); | |
24 | switch(c) | |
25 | { | |
26 | case '1': | |
27 | outfile << "#define UNREAL" << endl; | |
28 | outfile << "#undef BAHAMUT" << endl; | |
29 | break; | |
30 | case '2': | |
31 | outfile << "#undef UNREAL" << endl; | |
32 | outfile << "#define BAHAMUT" << endl; | |
33 | break; | |
34 | default: | |
35 | break; | |
36 | } | |
37 | }while (c != 'Q' && c != 'q' && (int(c) < 48) && (int(c) > 57)); | |
38 | ||
39 | outfile.close(); | |
40 | return 0; | |
41 | } | |
42 | ||
43 | char menu() | |
44 | { | |
45 | char selection = 0; | |
46 | ||
47 | cout << "Choose your IRCD" << endl; | |
48 | cout << "1. Unreal3.x\r\n" | |
49 | << "2. bahamut-1.4.x" << endl; | |
50 | cout << "Make your selection: "; | |
51 | cin >> selection; | |
52 | return selection; | |
53 | } |