diff options
-rw-r--r-- | dbox.c | 64 | ||||
-rw-r--r-- | levelF | 2 |
2 files changed, 42 insertions, 24 deletions
@@ -172,36 +172,38 @@ int main(int argc, char *argv[]) int play = FALSE; int base; int f; - int verbose = TRUE; + int verbose = FALSE; g_name = argv[0]; - if (argc<2) - { - fprintf(stderr,"%s: usage %s [-i|-p] file [file2 ...]\n", - g_name, g_name); - return EXIT_FAILURE; - } + base = 1; - if (strcmp(argv[1],"-i")==0) + while(argv[base] && argv[base][0] == '-') { - interact = TRUE; - base = 2; - } - else if (strcmp(argv[1],"-p")==0) - { - interact = TRUE; - play = TRUE; - base = 2; - } - else - { - base = 1; + switch(argv[base++][1]) + { + case 'i': + interact = TRUE; + break; + + case 'p': + interact = TRUE; + play = TRUE; + break; + + case 'v': + verbose = TRUE; + break; + + default: + base = argc; + break; + } } - if (argc <= base) + if (!argv[base]) { - fprintf(stderr,"%s: usage %s [-i|-p] file [file2 ...]\n", + fprintf(stderr,"%s: usage %s [-v|-i|-p] file [file2 ...]\n", g_name, g_name); return EXIT_FAILURE; } @@ -1230,7 +1232,23 @@ static void Interactive(const level_t *p_level, int play) if (!play) { - mvprintw(p_level->height + 9, 0, "Route:%s", route); + if (route[0]) + { + if (strlen(route) > COLS-6) + { + mvprintw(p_level->height + 9, 0, "Route:%*.*s...", + COLS-10, COLS-10, route); + } + else + { + mvprintw(p_level->height + 9, 0, "Route:%s", route); + } + } + else + { + mvprintw(p_level->height + 9, 0, "Route: None found -- " + "level possibly impossible"); + } } while(!quit) @@ -1,4 +1,4 @@ -Test Level +Short Targets Test ########## #@ # # # # |