diff --git a/src/inputHandler.c b/src/inputHandler.c new file mode 100644 index 0000000..da56212 --- /dev/null +++ b/src/inputHandler.c @@ -0,0 +1,14 @@ +#include "inputHandler.h" + +int getOperationId(char symbol) { + int id = 0; + switch (symbol) { + case '+': + return 1; + case '-': + return 2; + case '*': + return 3; + } + return id; +} \ No newline at end of file diff --git a/src/inputHandler.h b/src/inputHandler.h new file mode 100644 index 0000000..1014f4d --- /dev/null +++ b/src/inputHandler.h @@ -0,0 +1,6 @@ +#ifndef THEADMIRALS_INPUTHANDLER_H +#define THEADMIRALS_INPUTHANDLER_H + +int getOperationId(char); + +#endif //THEADMIRALS_INPUTHANDLER_H