Browse Source

Implemented reverse operation method for symbols

remotes/origin/develop
Eric Bagus 11 months ago
parent
commit
7e8decf5f9
  1. 26
      src/inputHandler.c
  2. 2
      src/inputHandler.h

26
src/inputHandler.c

@ -19,4 +19,28 @@ int getOperationId(char symbol) {
return 7; return 7;
} }
return id; return id;
}
}
char getOperationSymbol(int id) {
char symbol = ' ';
switch (id) {
case 1:
return '+';
case 2:
return '-';
case 3:
return '/';
case 4:
return '*';
case 5:
return '^';
case 6:
return '%';
case 7:
return '!';
}
return symbol;
}

2
src/inputHandler.h

@ -3,4 +3,6 @@
int getOperationId(char); int getOperationId(char);
char getOperationSymbol(int);
#endif //THEADMIRALS_INPUTHANDLER_H #endif //THEADMIRALS_INPUTHANDLER_H
Loading…
Cancel
Save