Skip to content
Snippets Groups Projects
Commit 528fbab7 authored by Taddeüs Kroes's avatar Taddeüs Kroes
Browse files

Updated ass7 usage.

parent 14aeba10
No related branches found
No related tags found
No related merge requests found
/*
* Usage: ./q7 [ generations [ max_age ] ]
*/
#include <stdlib.h>
#include <stdio.h>
#include <assert.h>
......@@ -87,14 +83,17 @@ void sequence_old(int n) {
}
int main(int argc, char *argv[]) {
int max_age = 0, generations = 10;
if( argc > 1 ) {
generations = atoi(argv[1]);
int max_age = 0, generations;
if( argc > 2 )
max_age = atoi(argv[2]);
if( argc < 2 ) {
printf("Usage: %s GENERATIONS [ MAX_AGE ]\n", argv[0]);
return 1;
}
generations = atoi(argv[1]);
if( argc > 2 )
max_age = atoi(argv[2]);
sequence(generations, max_age);
}
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