From dab7eb1e03e28d08036eaf1fcee9981cb98a0a92 Mon Sep 17 00:00:00 2001 From: tomsmeding Date: Sun, 19 Mar 2017 12:09:08 +0100 Subject: Introduce batch mode --- sim.cpp | 49 +++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 39 insertions(+), 10 deletions(-) diff --git a/sim.cpp b/sim.cpp index e1e94f8..95d20d2 100644 --- a/sim.cpp +++ b/sim.cpp @@ -48,7 +48,7 @@ int parseInt(const char *str){ } void usage(char **argv){ - cerr<<"Usage: "<]* [-p ]* [-s ] [-t]"<]* [-p ]* [-s ] [-t] [-B]"< robotSpecs; int sleeptime=3000; bool step = false; + bool batch = false; if(argc<=1){ usage(argv); @@ -109,6 +110,10 @@ int main(int argc,char **argv){ step = true; break; + case 'B': + batch = true; + break; + default: cerr<<"Unknown switch in '"<active){ + haveActive=true; + break; + } + } + if(!haveActive)break; + } + for(int y=0;yteam<<' ' + <heading<draw(); - for(int i=0;imvprintf(0, SIZE, "step: %5i", i+2); sb->draw(); + for(int i=0;imvprintf(0, SIZE, "step: %5i", i+2); + sb->draw(); + } } delete sb; } -- cgit v1.2.3-70-g09d2