-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.cpp
46 lines (37 loc) · 1021 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
/*Code by Dmitry Khovratovich, 2016
CC0 license
*/
#include "solver.h"
#include <inttypes.h>
#include <ctime>
#include "string.h"
#include <cstdlib>
using namespace _POW;
static void promptUsage() {
printf("Usage: [-h] [-n N] [-k K] [-s S]\n");
printf("Parameters:\n");
printf("\t-h \t\tPrint this help message\n");
printf("\t-n N\t\tTuple length of iterations to N\n");
printf("\t-k K\t\tNumber of steps to K perform\n");
printf("\t-s S\t\tSeed, can be interpreted as input\n");
printf("\t-v \t\tExtended output\n");
}
int main(int argc, char *argv[]) {
char *err = new char[256];
int* errlen = new int(0);
if (argc > 1 && !strcmp(argv[1], "-h")) {
promptUsage();
exit(1);
}
Input in = inputFromArgs(argc, argv, errlen, err);
if (*errlen > 0) {
printf("%s\n", err);
promptUsage();
exit(1);
}
in.printToConsole();
Solver solver(in);
Proof p = solver.FindProof();
p.ValidateProof();
return 0;
}