diff --git a/src/inputHandler.c b/src/inputHandler.c index 107b9df..0ecd1d6 100644 --- a/src/inputHandler.c +++ b/src/inputHandler.c @@ -1,4 +1,5 @@ #include "inputHandler.h" +#include int getOperationId(char symbol) { int id = 0; @@ -41,3 +42,8 @@ char getOperationSymbol(int id) { } return symbol; } + +int isOperationValid(int id) { + if(id < 0 || id > 7) return 0; + return 1; +} \ No newline at end of file diff --git a/src/inputHandler.h b/src/inputHandler.h index 98f1421..107f49e 100644 --- a/src/inputHandler.h +++ b/src/inputHandler.h @@ -5,4 +5,6 @@ int getOperationId(char); char getOperationSymbol(int); +int isOperationValid(int); + #endif //THEADMIRALS_INPUTHANDLER_H