Skip to content

oransimhony/calcy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Calcy

A CLI application I built using leex and yecc.

Calcy can solve expressions with + - * / ^ and also use variables.

Installation

For this program to work you need to have Elixir installed on your computer.

Clone to your computer using

https://github.com/oransimhony/calcy.git

Running

Enter the directory where you installed it

cd calcy

Build the application using

mix compile
mix escript.build

Or using make

make build

Run using

./calcy

You may need to change the permissions:

chmod +x ./calcy

Or using make

make

Or

make run

Clean using

make clean

And run iex with the project files using

make console

Usage

Write any expression normally

calcy> 1 + 2 * (4 / 2) ^ 12
8193.0

You can use the predefined constants $\pi$ and $e$

calcy> e / pi
0.8652559794322651

You can use both integers and floats

calcy> 15.3 ^ 0.5 - 123
-119.08847855687841

You can define variables

calcy> r = 5
5
calcy> area = pi * r ^ 2
78.53981633974483
calcy> diameter = r * 2
10
calcy> perimeter = pi * diameter
31.41592653589793

To see list of variables use

calcy> table
e:      2.718281828459045
pi:     3.141592653589793

To exit the program use

calcy> exit
Bye bye :)

(Or use CTRL+C)

Thank you for reading! Have fun using it ✨

Authors

Releases

No releases published

Packages

No packages published