From 48b661ef17844be58815b5aa8ce26d0b473b2610 Mon Sep 17 00:00:00 2001 From: KRUGSON Date: Sun, 5 Feb 2023 03:15:45 +0100 Subject: [PATCH] refactoring: function for accept rules --- src/c/main.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/c/main.c b/src/c/main.c index b0df59e..ecf1c18 100644 --- a/src/c/main.c +++ b/src/c/main.c @@ -12,6 +12,7 @@ char *gameInstructionsFile = "../../src/content/game_instructions.txt"; // function declarations void printInit(); +void acceptInstructions(); int main() { @@ -37,7 +38,7 @@ int main() } } return 0; -}; +} // init dialogue void printInit() @@ -64,6 +65,12 @@ void printInit() free(line); /* Deallocate allocated memory */ fclose(stream); /* closing file */ + acceptInstructions(); +} + +//accept rules and instructions for init dialogue +void acceptInstructions() +{ char userInput[1]; bool inputState = 0; int acceptCounter = 0; @@ -86,4 +93,4 @@ void printInit() printf("Invalid Input!\n"); } } -}; \ No newline at end of file +} \ No newline at end of file