summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJustin Worthe <justin.worthe@gmail.com>2015-05-24 22:24:31 +0200
committerJustin Worthe <justin.worthe@gmail.com>2015-05-24 22:24:31 +0200
commite6a53bb57e7c2e5ce17cdc10a51b40cd83ceb85e (patch)
tree89a628ea90f52632ec2a665705f396160980d6fd /src
parent08365e5558d800e108b2d377cf6c03397d1ff2c2 (diff)
Base bot
Diffstat (limited to 'src')
-rw-r--r--src/main.cpp17
-rw-r--r--src/spacebot.cpp12
2 files changed, 26 insertions, 3 deletions
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 <iostream>
+#include <string>
-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] << " <output folder>" << 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;
+}