https://github.com/gr3yknigh1/rpn
RPN graph visualizer
https://github.com/gr3yknigh1/rpn
c polish-notation rpn
Last synced: 10 months ago
JSON representation
RPN graph visualizer
- Host: GitHub
- URL: https://github.com/gr3yknigh1/rpn
- Owner: gr3yknigh1
- License: other
- Created: 2023-10-10T11:18:19.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2023-10-10T12:06:56.000Z (over 2 years ago)
- Last Synced: 2025-04-01T20:34:14.566Z (about 1 year ago)
- Topics: c, polish-notation, rpn
- Language: C
- Homepage:
- Size: 17.6 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Polish Notation
This project was build during Sber's School 21 bootcamp.
Team 70:
- [lambertm](https://github.com/manikala) (Team Lead): worked on graph renderer and initial lexer version
- [atruskat](https://github.com/eliot-geek): worked on infix to rpn conversion, and expression evaluation
- [wittenbb](https://github.com/gr3yknigh1) (me): tooling, expression parser and string tokenizer, `str` and `darray` datastructures
## How to use
Compile and run.
> NOTE: Has range from `0` to `4 PI` on X axis and from `-1` to `1` on Y axis.
Example input:
```shell
$ ./build/rpn
x * x
................................................................................
................................................................................
................................................................................
................................................................................
................................................................................
................................................................................
................................................................................
................................................................................
................................................................................
................................................................................
................................................................................
................................................................................
................................................................................
**..............................................................................
..*.............................................................................
...*............................................................................
................................................................................
....*...........................................................................
................................................................................
................................................................................
.....*..........................................................................
................................................................................
................................................................................
................................................................................
......*.........................................................................
```
## Supported operators:
* `+` - plus
* `-` - minus (binary and unary)
* `*` - multiplication
* `/` - division
* `(` and `)` - left and right parens
* `sin(...)` - sin
* `cos(...)` - cos
* `tan(...)` - tan
* `ctg(...)` - ctg
* `sqrt(...)` - sqrt
* `ln(...)` - ln
* `x` - variable
List of tokens avaiable in [token.h](./src/token.h).
## Build
Release build:
```shell
make release
```
Development build:
```shell
make all
```
## Tooling
Tests:
```shell
make test
```
Lint or format:
```shell
make lint
make fmt
```
Install git-hooks:
```shell
make hooks
```