https://github.com/iassasin/math-interpreter
https://github.com/iassasin/math-interpreter
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/iassasin/math-interpreter
- Owner: iassasin
- License: mit
- Created: 2018-09-03T20:00:59.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2018-09-03T20:02:47.000Z (almost 7 years ago)
- Last Synced: 2025-04-09T19:56:00.546Z (3 months ago)
- Language: JavaScript
- Size: 3.91 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Simple math interpreter
Made up just for fun.
No dependencies needed to run. Just use:
```
node index
```Supported operators: `+`, `-`, `*`, `/`, `%`. (No unary `-` and `+`!)
You can use variables:
```
> a = 5
5> b = 3
3> a + b * 2
11
```
Also has functions support:
```
> fn avg a b => (a + b) / 2> avg 1.5 2.5
2> avg avg 1 3 avg 9 11
5
```With great power comes great responsibility.