From ce3318404a44f39fc51c951643e18caa734c386d Mon Sep 17 00:00:00 2001 From: tomsmeding Date: Wed, 5 Apr 2017 16:01:17 +0200 Subject: Make exponent an optional command-line param --- attract.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/attract.c b/attract.c index 47f4a42..66fbee4 100644 --- a/attract.c +++ b/attract.c @@ -119,13 +119,18 @@ static void* thread_entry(void *arg_vp){ pthread_exit(NULL); } -int main(void){ +int main(int argc,char **argv){ struct config cfg={ .unitsz=200, .width=500, .height=500, .exponent=8.5 }; + assert(argc==1||argc==2); + if(argc==2){ + cfg.exponent=strtod(argv[1],NULL); + } + unsigned char img[cfg.width*cfg.height*3]; int nthreads=sysconf(_SC_NPROCESSORS_ONLN); -- cgit v1.2.3-70-g09d2