-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
46 lines (39 loc) · 927 Bytes
/
main.cpp
File metadata and controls
46 lines (39 loc) · 927 Bytes
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 <iostream>
#include "turniphelper.h"
#include "turnipexception.h"
using namespace std;
/*
Created by egg-bread on GitHub.
Last update: Sept 3, 2020
*/
void run(std::string csvFile)
{
// read in csv
vector<Turnip *> islandTurnips = getTurnips(csvFile);
// generate all ranges of turnip price pattern sequences
AllPricePatterns *allPriceSeqs = new AllPricePatterns();
// iterate over all islands to predict prices & generate graphs
predictTurnips(islandTurnips, allPriceSeqs->getAllPrices());
delete allPriceSeqs;
}
int main(int argc, char **argv)
{
if (argc == 2)
{
try
{
run(argv[argc - 1]);
}
catch (TurnipException &e)
{
cout << e.what() << endl;
return 1;
}
}
else
{
cout << INVALID_ARG_NUM << endl;
cout << HELP_MSG << endl;
return 1;
}
}