diff options
-rw-r--r-- | 5.c | 18 |
1 files changed, 17 insertions, 1 deletions
@@ -119,8 +119,24 @@ main(int argc, char ** argv) struct crate ** stack = NULL; regex_t movecmd; - while ((i = getopt(argc, argv, "m:")) != -1) { + while ((i = getopt(argc, argv, "p:m:")) != -1) { switch (i) { + case 'p': + switch (atoi(optarg)) { + case 1: + crates_move = crates_move_9000; + break; + + case 2: + crates_move = crates_move_9001; + break; + + default: + fprintf(stderr, "Unexpected puzzle part %s\n", optarg); + return -1; + } + break; + case 'm': if (strcmp(optarg, "9000") == 0) crates_move = crates_move_9000; |