Change to invoke orca_run and reject bad time args
#include "base.h"
#include "field.h"
+#include "sim.h"
#include <getopt.h>
int main(int argc, char** argv) {
@@ -16,7 +17,13 @@ int main(int argc, char** argv) {
switch (c) {
case 't':
ticks = atoi(optarg);
+ if (ticks == 0 && strcmp(optarg, "0")) {
+ fprintf(stderr, "Bad time argument %s\n", optarg);
+ return 1;
+ }
break;
+ case '?':
+ return 1;
}
}
@@ -58,6 +65,9 @@ int main(int argc, char** argv) {
fprintf(stderr, "File load error: %s\n", errstr);
return 1;
}
+ for (int i = 0; i < ticks; ++i) {
+ orca_run(&field);
+ }
field_fput(&field, stdout);
field_deinit(&field);
return 0;
