-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.cpp
46 lines (44 loc) · 1.19 KB
/
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
#include "mainwindow.h"
#include <QApplication>
void test(){
vector<int> vec;
vec.push_back(1);
vec.push_back(2);
vec.push_back(3);
vec.push_back(4);
vec.push_back(5);
qDebug() << "before";
for(vector<int>::iterator iterator = vec.begin(); iterator!=vec.end(); iterator++){
qDebug() << *iterator;
}
srand(static_cast<unsigned int>(clock()));
std::random_shuffle(std::begin(vec), std::end(vec));
qDebug() << "after";
for(vector<int>::iterator iterator = vec.begin(); iterator!=vec.end(); iterator++){
qDebug() << *iterator;
}
}
int main(int argc, char *argv[])
{
//Toggle this to start saving to new data files
bool save_tests = false;
FileIO number_file("test_number.txt");
string test;
if(save_tests){
test = number_file.readFile();
cout << test << endl;
}else{
test = "-1";
}
QApplication a(argc, argv);
MainWindow w(test);
if(save_tests){
int test_number = stoi(test);
test_number++;
number_file.writeFile(to_string(test_number));
}
w.show();
return a.exec();
// test();
// return 0;
}