From 10a402f32a6d443e959b2caed187bccf161c1645 Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Wed, 28 Mar 2018 16:08:46 -0400 Subject: Modernized bot --- main.cpp | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 main.cpp (limited to 'main.cpp') diff --git a/main.cpp b/main.cpp new file mode 100644 index 0000000..fe12ea5 --- /dev/null +++ b/main.cpp @@ -0,0 +1,32 @@ +#include "cadence.h" +#include + +int main(int argc, char** argv) +{ + std::random_device randomDevice; + std::mt19937 rng(randomDevice()); + + if (argc != 2) + { + std::cout << "usage: cadence [configfile]" << std::endl; + return -1; + } + + std::string configfile(argv[1]); + + try + { + cadence 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; + } +} -- cgit 1.4.1