From e6a53bb57e7c2e5ce17cdc10a51b40cd83ceb85e Mon Sep 17 00:00:00 2001 From: Justin Worthe Date: Sun, 24 May 2015 22:24:31 +0200 Subject: Base bot --- src/main.cpp | 17 ++++++++++++++--- src/spacebot.cpp | 12 ++++++++++++ 2 files changed, 26 insertions(+), 3 deletions(-) create mode 100644 src/spacebot.cpp (limited to 'src') diff --git a/src/main.cpp b/src/main.cpp index 9aeccde..1621ba8 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,7 +1,18 @@ #include +#include -int main() +#include "spacebot.h" + +int main(int argc, char* argv[]) { - std::cout << "Hello world" << std::endl; - return 0; + if (argc < 2) { + std::cout << "usage: " << argv[0] << " " << std::endl; + return 1; + } + + std::string outputFolder = argv[1]; + Spacebot bot(outputFolder); + bot.writeNextMove(); + + return 0; } diff --git a/src/spacebot.cpp b/src/spacebot.cpp new file mode 100644 index 0000000..0fc39b1 --- /dev/null +++ b/src/spacebot.cpp @@ -0,0 +1,12 @@ +#include "spacebot.h" + +Spacebot::Spacebot(const std::string& outputPath) + : mapStream(outputPath+"map.txt", std::ifstream::in) + , resultStream(outputPath+"move.txt", std::ofstream::out) +{ +} + +void Spacebot::writeNextMove() +{ + resultStream << "Shoot" << std::endl; +} -- cgit v1.2.3