-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.cpp
47 lines (37 loc) · 893 Bytes
/
main.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
#include <iostream>
#include <string>
#include "Wordle.hpp"
using namespace std;
int main(int argc, char **argv){
// 取得執行檔路徑
string directory = argv[0];
// 取得執行檔目錄
while(directory.back() != '/' && directory.back() != '\\'){
directory.pop_back();
}
// 建立wordle
Wordle wd(directory);
// 建立困難度和模式
char difficulty = 'n';
char mode = 's';
// 開始執行程式
while(true){
cout << "Select difficulty" << endl;
cout << "n = normal, h = hard" << endl;
cin >> difficulty;
cout << "Select mode" << endl;
cout << "s = solve mode, t = test mode" << endl;
cin >> mode;
wd.change_difficulty(difficulty);
wd.change_mode(mode);
if(mode == 's'){
wd.solve();
}
else if(mode == 't'){
int test_times = 0;
cout << "Input test times" << endl;
cin >> test_times;
wd.print_test_result(test_times);
}
}
}