https://github.com/radiopotin/computorv1
2nd degree equation solver, first experience in functional programming. 42Paris course project
https://github.com/radiopotin/computorv1
42paris 42school computorv1 functional-programming ocaml
Last synced: 3 months ago
JSON representation
2nd degree equation solver, first experience in functional programming. 42Paris course project
- Host: GitHub
- URL: https://github.com/radiopotin/computorv1
- Owner: RadioPotin
- License: isc
- Created: 2021-04-02T14:19:12.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2022-05-21T11:37:57.000Z (over 3 years ago)
- Last Synced: 2023-03-08T15:03:48.953Z (over 2 years ago)
- Topics: 42paris, 42school, computorv1, functional-programming, ocaml
- Language: OCaml
- Homepage: https://radiopotin.github.io/computorv1/
- Size: 4.07 MB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# ComputorV1 [](https://github.com/RadioPotin/computorv1/actions) [](https://RadioPotin.github.io/computorv1/coverage/)
# Building
```
dune build @all
```
creates an executable
```
_build/default/src/computor.exe
```
to which you can feed a polynome to solve.# Testing
```
dune runtest
```
This will run all tests contained in the folder `test`.# Usage
```
dune exec -- src/computor.exe
````` being a string that defines a polynome of degree inferior or equal to 2.
The program accepts an equation if and only if there is at least one monome on each sides of an equal sign.
# Examples of accepted forms of monomes
Each of the following accepted monome forms may be combined in a single polynomial expression though separated by `-` and `+` signs.
Variable `a` stands for a coefficient.
Variable `x` stands for a variable names like "X", "YO" or "papopi"
Variable `n` stands for the exponent part of the term.
`a * x^n`
`ax^n`
`a * x`
`ax`
`x^n`
`x`
`a`
## Running in Docker
The repo has a Dockerfile with everything necessary for you to just run.
**Building image**
```shell-session
docker build -t : .
```Make sure to replace build `name` and `user` accordingly.
**Interactive mode**
```shell-session
docker run --rm -it --entrypoint bash :
```**Running cli inside docker**
Either:
1. Wrap commands in `opam exec`
```shell-session
$ opam exec -- dune exec -- src/computor.exe
```2. `eval $(opam env)` to have all required binaries in your path
```shell-session
$ eval $(opam env)
$ dune exec -- src/computor.exe
```### Details [Here](https://radiopotin.github.io/computorv1/)