A command line tool that calculates the value of an expression.
A simple tool that takes in an expression, calculates the value of it and prints it.
- All you need to compile this is the odin compiler along with the standard odin packages(core, base, ect)
- To build the program, clone the repo and run this command:
odin build cmd-calc
- If you want you can also add it to path to be able to run it from anywhere
-
To use the program, just run it in the command line followed by an expression
-
Note that cmd-calc.exe could also be cmd-calc or cmd-calc.bin
./cmd-calc.exe (20+4*(23/PI)*(23/(e*5)))
- You can also print the help message
./cmd-calc.exe --help
- There are also other flags that let you for example visualize the evaluation of the expression
./cmd-calc.exe 2+3-(23/2*5) --tree
It's just odin code, there shouldn't be any major problems apart from the code being bad. If you have a problem maybe try checking your odin version and if it's outdated, update it.
To check the version run this in your command prompt:
odin version
Distributed under the MIT License.
-
More error handling
-
Add an ascii fallback to the tree visualization in case the unicode is broken