rpn-calculator

A text-based calculator that can evaluate prefix, infix, and postfix expressions (Part of Code Everyday 2020)

rpn-calculator

License License

This project is a calculator that can parse both RPN and infix expressions. It uses the shunting yard algorithm to transpile infix expressions into RPN expressions. Then, it uses a stack machine to get the result of the RPN expression.

Getting Started

These are the steps to quickly deploy this app.

Prerequisites

The programming language used for this project is Crystal, which means an Linux environment is needed in order to compile the code. Readline and PCRE have to be installed to the Linux environment as well in order to compile the code.

Installing

Refer to the Development section for more information. Binary releases will be added in the future to the GitHub repo.

Usage

TODO: Write usage instructions here So far, only REPL is supported for the calculator. Support for command-line arguments is planned.

Development

After checking out the repo, run shards install to install the necessary dependencies. Then, run crystal spec to run the tests.

git clone https://github.com/Afront/Project-Pebbles.git
cd Project-Pebbles/rpn-calculator
shards install
crystal build
./bin/crystal

Contributing

  1. Fork it (https://github.com/your-github-user/rpn-calculator/fork)
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

License

License License

This project is dual-licensed under Apache 2.0 and the MIT license.

Repository

rpn-calculator

Owner
Statistic
  • 0
  • 0
  • 0
  • 0
  • 2
  • about 4 years ago
  • February 1, 2020
License

Apache License 2.0

Links
Synced at

Thu, 16 May 2024 12:13:45 GMT

Languages