diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..6646460 --- /dev/null +++ b/Makefile @@ -0,0 +1,8 @@ +all: + cc *.cpp -O3 -Wall -Wextra -std=c++17 -o lottery + +compile: + cc *.cpp -O3 -c + +debug: + cc *.cpp -g -std=c++17 -o calculator -lstdc++ -lm diff --git a/constants.h b/constants.h new file mode 100644 index 0000000..1e92aad --- /dev/null +++ b/constants.h @@ -0,0 +1,4 @@ +#pragma once + +constexpr int MAX_VALUES = 100; +constexpr int DEFAULT_NR_ENTRIES = 10; diff --git a/input_parsing.cpp b/input_parsing.cpp new file mode 100644 index 0000000..64d1015 --- /dev/null +++ b/input_parsing.cpp @@ -0,0 +1,14 @@ +#include "input_parsing.h" +#include "constants.h" + +ProgramOptions get_params(int argc, char *argv[]) +{ + int max_range = MAX_VALUES, num_entries = DEFAULT_NR_ENTRIES; + bool is_seed_specified = false; + + int option; + + while (( option = getopt_long(argc, argv, "" + + return {max_range, num_entries, seed}; +} diff --git a/input_parsing.h b/input_parsing.h new file mode 100644 index 0000000..4df4c35 --- /dev/null +++ b/input_parsing.h @@ -0,0 +1,12 @@ +#pragma once + +#include + +struct ProgramOptions +{ + int max_range = 0; + int num_entries = 0; + std::optional seed; +}; + +ProgramOptions get_params(); diff --git a/lottery b/lottery new file mode 100755 index 0000000..effa464 Binary files /dev/null and b/lottery differ diff --git a/main.cpp b/main.cpp new file mode 100644 index 0000000..8e5a1e5 --- /dev/null +++ b/main.cpp @@ -0,0 +1,9 @@ +#include "input_parsing.h" + +#include + +int main(int argc, char *argv[]) +{ + auto parameters = get_params(); + return 0; +}