diff options
| author | Preston Pan <preston@nullring.xyz> | 2023-02-06 13:48:14 -0800 |
|---|---|---|
| committer | Preston Pan <preston@nullring.xyz> | 2023-02-06 13:48:14 -0800 |
| commit | 8b000505cb73d0ce5ad3d0e527143befb23c8e41 (patch) | |
| tree | b8008c0dfb2bcf48ef96d48bbf280f31e043e24e | |
| parent | a6d815eff457cdc779932b2a53d6ad518ae8c1bc (diff) | |
documentation change
| -rw-r--r-- | doc/snake3.1 | 7 | ||||
| -rw-r--r-- | snake.c | 5 |
2 files changed, 9 insertions, 3 deletions
diff --git a/doc/snake3.1 b/doc/snake3.1 index 961c4eb..d8d8235 100644 --- a/doc/snake3.1 +++ b/doc/snake3.1 @@ -3,7 +3,7 @@ snake3 \- small command line snake program .SH SYNOPSIS -\fBsnake3\fP [--version] [--help] +\fBsnake3\fP [--version] [--help] [--size board_size] [--speed speed] .SH DESCRIPTION You control a snake, and the objective is to grow as long as possible. @@ -17,7 +17,10 @@ keys to navigate. The game becomes faster as you grow. \fB--help\fP \-\- Displays the usage information for the snake3 program. - +\fB--size\fP +\-\- Sets the board size - the board is a square so only one number is taken as an input +\fB--speed\fP +\-\- Sets the speed of the snake - up to 10. .SH AUTHORS Developed and maintained by Kai Stevenson, with features added by Preston Pan. @@ -44,7 +44,7 @@ int main(int argc, char **argv) { return 0; } else if(strcmp("--help", argv[i]) == 0) { - printf("usage: snake3 [--version] [--help]\n"); + printf("usage: snake3 [--version] [--help] [--size board_size] [--speed speed]\n"); return 0; } else if (strcmp("--size", argv[i]) == 0 || strcmp("--speed", argv[i]) == 0) { @@ -64,6 +64,9 @@ int main(int argc, char **argv) { if (speed <= 0) { fprintf(stderr, "%sspeed level must be greater than zero and integer. Please try again.%s\n", RED, COLOR_RESET); exit(1); + } if (speed > 10) { + fprintf(stderr, "%sspeed must not be greater than ten. Please try again.%s\n", RED, COLOR_RESET); + exit(1); } } was_flag = 0; |
