From 5e21520280d366bd921a7fc9c7f4db8d6e57b45c Mon Sep 17 00:00:00 2001 From: Eric Bagus Date: Thu, 8 Feb 2024 22:00:23 +0100 Subject: [PATCH] Added number size check in input handler --- src/inputHandler.c | 8 +++++++- src/inputHandler.h | 2 ++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/inputHandler.c b/src/inputHandler.c index 47e5df1..f11f806 100644 --- a/src/inputHandler.c +++ b/src/inputHandler.c @@ -1,5 +1,5 @@ #include "inputHandler.h" -#include +#include // return operation id for a specific symbol int getOperationIdBySymbol(char symbol) { @@ -49,4 +49,10 @@ char getOperationSymbolById(int id) { int isOperationIdValid(int id) { if(id < 0 || id > 7) return 0; return 1; +} + +int isNumberTooBig(int number) { + if(number < 200) return 0; + printf("Diese Nummer ist zu groß"); + return 1; } \ No newline at end of file diff --git a/src/inputHandler.h b/src/inputHandler.h index 6e4e4d5..372f9d0 100644 --- a/src/inputHandler.h +++ b/src/inputHandler.h @@ -7,4 +7,6 @@ char getOperationSymbolById(int); int isOperationIdValid(int); +int isNumberTooBig(int); + #endif //THEADMIRALS_INPUTHANDLER_H