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