From bf5fa43b838cfea11e16a3339b10174ea28ea918 Mon Sep 17 00:00:00 2001 From: SemperVinco Date: Fri, 3 Mar 2017 14:21:03 +0100 Subject: add single step option -t, make step printing accurate --- main.cpp | 13 ++++++++++--- parse.cpp | 2 +- parse.h | 2 +- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/main.cpp b/main.cpp index 7786149..e1e94f8 100644 --- a/main.cpp +++ b/main.cpp @@ -48,7 +48,7 @@ int parseInt(const char *str){ } void usage(char **argv){ - cerr<<"Usage: "<]* [-p ]* [-s ]"<]* [-p ]* [-s ] [-t]"< robotSpecs; int sleeptime=3000; + bool step = false; if(argc<=1){ usage(argv); @@ -104,6 +105,10 @@ int main(int argc,char **argv){ i+=1; break; + case 't': + step = true; + break; + default: cerr<<"Unknown switch in '"<draw(); for(int i=0;imvprintf(0, SIZE, "step: %5i", i); + sb->mvprintf(0, SIZE, "step: %5i", i+2); sb->draw(); } delete sb; diff --git a/parse.cpp b/parse.cpp index a0267cc..cbfb306 100644 --- a/parse.cpp +++ b/parse.cpp @@ -199,4 +199,4 @@ string preprocess(istream &file){ } return result; -} \ No newline at end of file +} diff --git a/parse.h b/parse.h index 7af8b2a..fc6cd0e 100644 --- a/parse.h +++ b/parse.h @@ -8,4 +8,4 @@ using namespace std; Team assemble(const string &source); -string preprocess(istream &file); \ No newline at end of file +string preprocess(istream &file); -- cgit v1.2.3-54-g00ecf