From b160d1a647e6c0f4d9d25a6f414b0fe61a9a385d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Denis=20Nut=CC=A6iu?= Date: Thu, 21 Apr 2016 16:58:45 +0300 Subject: [PATCH] Modifing problem to work from the commandline --- lab9/1.c | 6 +++++- lab9/test.svg | 9 +++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/lab9/1.c b/lab9/1.c index bb8c1fb..0329b96 100644 --- a/lab9/1.c +++ b/lab9/1.c @@ -45,7 +45,11 @@ int main(int argc, char *argv[]) { perror("Can't open file!"); return -1; } - draw_peg_scene(file, 3, 10); + if ( argc < 3 ) { + printf("Invalid ussage. Correct usage: %s pegs disks\n", argv[0]); + return -1; + } + draw_peg_scene(file, atoi(argv[1]), atoi(argv[2])); if ( fclose(file) ) { perror("Can't close file!"); diff --git a/lab9/test.svg b/lab9/test.svg index 33b81c2..fbd450c 100644 --- a/lab9/test.svg +++ b/lab9/test.svg @@ -3,10 +3,7 @@ - - - - - - + + + \ No newline at end of file