-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
25 lines (24 loc) · 783 Bytes
/
main.cpp
File metadata and controls
25 lines (24 loc) · 783 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
#include "linear_congruential_generator.hpp"
#include "prng.hpp"
#include "program_runner.hpp"
#include "xorshift.hpp"
#include <getopt.h>
#include <iostream>
int main(int argc, char* argv[])
{
ProgramRunner runner = ProgramRunner(argc, argv, 1000);
ProgramRunner::ProgramStatus status;
while (!runner.is_finished()) {
status = runner.iterate();
if (status.stdout_message.has_value()) {
std::cout << status.stdout_message.value() << std::endl;
}
if (status.stderr_message.has_value()) {
std::cerr << status.stderr_message.value() << std::endl;
}
if (status.exit_code.has_value()) {
exit(status.exit_code.value());
}
}
exit(1); // If we reach here, something went wrong
}