From 2aa1aaa17d42f45dd2a22147b87cc7c57ad83c54 Mon Sep 17 00:00:00 2001 From: Eric Bagus Date: Thu, 8 Feb 2024 17:51:20 +0100 Subject: [PATCH] Added input operation handler operation check --- src/operationHandler.c | 10 ++++++++++ src/operationHandler.h | 7 +++++++ 2 files changed, 17 insertions(+) create mode 100644 src/operationHandler.c create mode 100644 src/operationHandler.h diff --git a/src/operationHandler.c b/src/operationHandler.c new file mode 100644 index 0000000..0f63fb7 --- /dev/null +++ b/src/operationHandler.c @@ -0,0 +1,10 @@ +#include "operationHandler.h" +#include + +bool checkOperationInput(int input) { + switch (input) { + case 4: case 3: case 2: case 1: + return true; + } + return false; +} \ No newline at end of file diff --git a/src/operationHandler.h b/src/operationHandler.h new file mode 100644 index 0000000..5293b1e --- /dev/null +++ b/src/operationHandler.h @@ -0,0 +1,7 @@ +#ifndef THEADMIRALS_OPERATIONHANDLER_H +#define THEADMIRALS_OPERATIONHANDLER_H +#include + +bool checkOperationInput(int); + +#endif //THEADMIRALS_OPERATIONHANDLER_H