From 0bb6d64c929b237278abf2565b6eb9f5f85fcd37 Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Sun, 29 Oct 2017 09:55:03 -0400 Subject: Created bot --- main.cpp | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 main.cpp (limited to 'main.cpp') diff --git a/main.cpp b/main.cpp new file mode 100644 index 0000000..ffcd4a2 --- /dev/null +++ b/main.cpp @@ -0,0 +1,33 @@ +#include "capital.h" + +int main(int argc, char** argv) +{ + Magick::InitializeMagick(nullptr); + + std::random_device randomDevice; + std::mt19937 rng(randomDevice()); + + if (argc != 2) + { + std::cout << "usage: capital [configfile]" << std::endl; + return -1; + } + + std::string configfile(argv[1]); + + try + { + capital bot(configfile, rng); + + try + { + bot.run(); + } catch (const std::exception& ex) + { + std::cout << "Error running bot: " << ex.what() << std::endl; + } + } catch (const std::exception& ex) + { + std::cout << "Error initializing bot: " << ex.what() << std::endl; + } +} \ No newline at end of file -- cgit 1.4.1