From 9101c98f951e7b104e6969fd5984379ca04745ea Mon Sep 17 00:00:00 2001 From: thecharlesblake Date: Mon, 16 Oct 2017 14:15:25 +0100 Subject: Add demo command line parsing --- src/main/command_line_helper.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 src/main/command_line_helper.h (limited to 'src/main/command_line_helper.h') diff --git a/src/main/command_line_helper.h b/src/main/command_line_helper.h new file mode 100644 index 0000000..dc3b2b6 --- /dev/null +++ b/src/main/command_line_helper.h @@ -0,0 +1,12 @@ +// +// Created by thecharlesblake on 10/16/17. +// + +#ifndef SOLVITAIRE_COMMAND_LINE_HELPER_H +#define SOLVITAIRE_COMMAND_LINE_HELPER_H + +#include + +boost::program_options::options_description get_options_desc(); + +#endif //SOLVITAIRE_COMMAND_LINE_HELPER_H -- cgit v1.2.1 From dc01ab729c749fbfd2421943198a038d126aa66c Mon Sep 17 00:00:00 2001 From: thecharlesblake Date: Mon, 16 Oct 2017 22:56:16 +0100 Subject: Add simple black hole cmdline parse & err handling --- src/main/command_line_helper.h | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) (limited to 'src/main/command_line_helper.h') diff --git a/src/main/command_line_helper.h b/src/main/command_line_helper.h index dc3b2b6..53a5a5e 100644 --- a/src/main/command_line_helper.h +++ b/src/main/command_line_helper.h @@ -7,6 +7,28 @@ #include -boost::program_options::options_description get_options_desc(); +class command_line_helper { +public: + command_line_helper(); + bool parse(int argc, const char* argv[]); + void print_help(); + void print_no_input_error(); + void print_no_sol_type_error(); + void print_rand_plus_input_err(); + const std::vector get_input_files(); + const std::string get_solitaire_type(); + bool get_random_deal(); + bool get_help(); + bool assess_errors(); +private: + boost::program_options::options_description cmdline_options; + boost::program_options::options_description main_options; + boost::program_options::positional_options_description p; + + std::vector input_files; + std::string solitaire_type; + bool random_deal; + bool help; +}; #endif //SOLVITAIRE_COMMAND_LINE_HELPER_H -- cgit v1.2.1 From 3eff79ed14f1fda1f148a9a4c5c3a1ae4edbee37 Mon Sep 17 00:00:00 2001 From: thecharlesblake Date: Thu, 26 Oct 2017 14:51:13 +0100 Subject: BH Solver with path outputted, based on user input --- src/main/command_line_helper.h | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/main/command_line_helper.h') diff --git a/src/main/command_line_helper.h b/src/main/command_line_helper.h index 53a5a5e..3454bfb 100644 --- a/src/main/command_line_helper.h +++ b/src/main/command_line_helper.h @@ -11,16 +11,17 @@ class command_line_helper { public: command_line_helper(); bool parse(int argc, const char* argv[]); - void print_help(); - void print_no_input_error(); - void print_no_sol_type_error(); - void print_rand_plus_input_err(); const std::vector get_input_files(); const std::string get_solitaire_type(); bool get_random_deal(); bool get_help(); - bool assess_errors(); private: + bool assess_errors(); + void print_help(); + void print_no_input_error(); + void print_no_sol_type_error(); + void print_rand_plus_input_err(); + boost::program_options::options_description cmdline_options; boost::program_options::options_description main_options; boost::program_options::positional_options_description p; -- cgit v1.2.1 From a841befd0ecdc0b469d6bc46b209f259358778ec Mon Sep 17 00:00:00 2001 From: thecharlesblake Date: Fri, 27 Oct 2017 23:25:50 +0100 Subject: Add random game generation to bh --- src/main/command_line_helper.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/main/command_line_helper.h') diff --git a/src/main/command_line_helper.h b/src/main/command_line_helper.h index 3454bfb..97c522a 100644 --- a/src/main/command_line_helper.h +++ b/src/main/command_line_helper.h @@ -13,7 +13,7 @@ public: bool parse(int argc, const char* argv[]); const std::vector get_input_files(); const std::string get_solitaire_type(); - bool get_random_deal(); + int get_random_deal(); bool get_help(); private: bool assess_errors(); @@ -28,7 +28,7 @@ private: std::vector input_files; std::string solitaire_type; - bool random_deal; + int random_deal; bool help; }; -- cgit v1.2.1 From 70522b28586ba117ff9e1e27c8f4b183f8414fd1 Mon Sep 17 00:00:00 2001 From: thecharlesblake Date: Sat, 28 Oct 2017 10:13:13 +0100 Subject: Add simple and regular bh types --- src/main/command_line_helper.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/main/command_line_helper.h') diff --git a/src/main/command_line_helper.h b/src/main/command_line_helper.h index 97c522a..5694830 100644 --- a/src/main/command_line_helper.h +++ b/src/main/command_line_helper.h @@ -17,6 +17,7 @@ public: bool get_help(); private: bool assess_errors(); + bool assess_sol_type(); void print_help(); void print_no_input_error(); void print_no_sol_type_error(); -- cgit v1.2.1