From 404ae7f6478314dfddf9e2686f5098c277274207 Mon Sep 17 00:00:00 2001 From: Lily Date: Thu, 22 May 2025 17:38:22 +1000 Subject: [PATCH] Allow configuration of difficulty --- src/agg.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/agg.c b/src/agg.c index ed46d97..c095d7e 100644 --- a/src/agg.c +++ b/src/agg.c @@ -19,6 +19,10 @@ int main(void) { printf ("\nHow long would you like to play for? Answer in seconds.\n"); scanf ("%d", &playtime); + int number_length; + printf ("Please enter maximum possible number\n"); + scanf ("%d", & number_length); + time_t unix_time; unix_time = time(NULL); int end_time = unix_time + playtime; @@ -30,8 +34,8 @@ int main(void) { // I can't remember what the fuck these are for while (unix_time < end_time) { - float num1 = rand() % 10 + 1; - float num2 = rand() % 10 + 1; + float num1 = rand() % number_length + 1; + float num2 = rand() % number_length + 1; int type = rand() % 4 + 1; float result; float answer;