Skip to content
Snippets Groups Projects
Commit f4146180 authored by Jake Feddersen's avatar Jake Feddersen
Browse files

Remove sleep parameter that is no longer relevant

parent 1b48c29c
No related branches found
No related tags found
No related merge requests found
......@@ -27,9 +27,8 @@ void parse_args(int argc, char *argv[], args_t *args) {
// Default parameter values
args->load = 0;
args->save = 0;
args->nummon = 5;
args->nummon = 7;
args->seed = time(NULL);
args->sleeptime = 250000;
int valid = 1;
......@@ -50,13 +49,7 @@ void parse_args(int argc, char *argv[], args_t *args) {
} else {
valid = 0;
}
} else if (!strncmp(argv[i], "--step=", 7)) {
if (strlen(argv[i]) > 7) {
args->sleeptime = atoi(argv[i] + 7);
} else {
valid = 0;
}
} else if (!strcmp(argv[i], "-h")) {
} else if (!strcmp(argv[i], "-h")) {
valid = 0;
} else {
valid = 0;
......@@ -64,12 +57,11 @@ void parse_args(int argc, char *argv[], args_t *args) {
}
if (!valid) {
fprintf(stderr, "Usage: %s [--load --save --dbg --seed=<seed> --nummon=<monsters to spawn>\n\t\t\t--step=<step time in us>]\n\n", argv[0]);
fprintf(stderr, "Usage: %s [--load --save --seed=<seed> --nummon=<monsters to spawn>]\n", argv[0]);
fprintf(stderr, " --load: \tInstead of generating a random dungeon, loads the saved dungeon\n\t\tfile from ~/.rlg327/dungeon\n");
fprintf(stderr, " --save: \tSaves the dungeon to ~/.rlg327/dungeon\n");
fprintf(stderr, " --seed: \tSeeds the random number generator to the given value. If not\n\t\tspecified, time(NULL) is used as the seed\n");
fprintf(stderr, " --nummon:\tSets the number of monsters to generate in the dungeon. If not\n\t\tspecified, the default is 5. Automatically capped at the number\n\t\tof empty spaces in the dungeon.\n\t\tIf nummon is 0, the game never ends and the PC wanders the\n\t\tdungeon endlessly.\n");
fprintf(stderr, " --step: \tSets the time to sleep between each game player turn step.\n\t\tDefault is 250000 us.\n");
fprintf(stderr, " --nummon:\tSets the number of monsters to generate in the dungeon. If not\n\t\tspecified, the default is 7. Automatically capped at the number\n\t\tof empty spaces in the dungeon.\n\t\tIf nummon is 0, the game never ends and the PC wanders the\n\t\tdungeon endlessly.\n");
fprintf(stderr, " -h: \tPrints this help information and exits\n");
exit(1);
}
......
......@@ -36,7 +36,6 @@ typedef struct args {
int save;
int seed;
int nummon;
int sleeptime;
} args_t;
typedef struct {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment