Kalk
A CLI calculator written in Kotlin
kalk
A CLI calculator written in Kotlin.
Notable features
- This program implements the shunting-yard in Kotlin as an extension method on
String
- see String.toRPNExpression(). - Also implemented is an RPN expression evaluator which is fairly succinct thanks to the use of the
Operator
sealed class which can be found here.
Usage
$ kalk
for interactive mode$ kalk 2 + 2
to verify two plus two is in fact four!
Installation
- Install with NPM:
$ npm i -g kalk
Build & run from source
$ git clone git@github.com:zachgrayio/kalk.git
$ cd kalk
$ ./gradlew assembleDist
$ unzip build/distributions/kalk-1.1.0.zip
- inline:
$ kalk-1.1.0/bin/kalk 2 + 2
- interactive:
$ kalk-1.1.0/bin/kalk
Repository Information
You can view this repository on GitHub here:
https://github.com/zachgrayio/kalk
https://github.com/zachgrayio/kalk