-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cpp
executable file
·63 lines (50 loc) · 1.27 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#include <iostream>
#include <stdlib.h>
#include <string.h>
#include <vector>
#include <chrono>
#include "sqrt.h"
#include "dependencies.h"
#include "variables.h"
#include "engine.h"
#include <cstdint>
using namespace std;
int main() {
// Splash screen
line();
cout << "\033[1;32mEntropy++ v0.1.2 alpha\033[0m" << endl;
cout << "Up to 18 digits (for now)!" << endl;
line();
// Prompt
repeat = 'y';
while(repeat == 'y') {
// Clear factor list
factorLs.clear();
primeLs.clear();
primeLs.push_back(2); // Initialize prime storage with 2
// Get number from user
getn();
// Start execution time
auto t1 = chrono::high_resolution_clock::now();
// Run
line();
engine();
// End execution time
auto t2 = chrono::high_resolution_clock::now();
// Calculate time
chrono::duration<double, std::milli> ms_double = t2 - t1;
// Show all primes used in testing
line();
cout << "#primes: " << primeLs.size() << endl;
// Print execution time
line();
cout << "Finished in " << ms_double.count() << " ms" << endl;
// Print log
line();
printLog();
// Ask for another run
cout << "Repeat? [y/n] ";
cin >> repeat;
}
return 0;
}