diff options
Diffstat (limited to '19.c')
-rw-r--r-- | 19.c | 13 |
1 files changed, 10 insertions, 3 deletions
@@ -293,7 +293,7 @@ main(int argc, char ** argv) { int rounds = 24; char const * build = "basic"; - int i; + int quality = 0, i; regex_t reblueprint; char buf[BUFSIZ]; @@ -351,12 +351,14 @@ main(int argc, char ** argv) else if (strcmp(build, "exhaustive") == 0) { exhaustive_iter = 0; inventory_build_exhaustive(&i, &b, rounds); - fprintf(stdout, "Blueprint %d, iterations %ld, ore %d/%d, clay %d/%d, bsdn %d/%d, geod %d/%d\n", +#if 0 + fprintf(stderr, "Blueprint %d, iterations %ld, ore %d/%d, clay %d/%d, bsdn %d/%d, geod %d/%d\n", b.id, exhaustive_iter, i.ore.amount, i.ore.robots, i.clay.amount, i.clay.robots, i.bsdn.amount, i.bsdn.robots, i.geod.amount, i.geod.robots); +#endif } else { fprintf(stderr, "Unknown build strategy: %s\n", build); @@ -364,9 +366,14 @@ main(int argc, char ** argv) return -1; } - printf("Blueprint %d geodes = %d\n", b.id, i.geod.amount); + quality += b.id * i.geod.amount; +#if 0 + fprintf(stderr, "Blueprint %d geodes = %d\n", b.id, i.geod.amount); +#endif } + printf("Total quality level = %d\n", quality); + regfree(&reblueprint); return 0; |