A simple calculator built with React.
Check the calculator working in the browser.
You can use your keyboard to interact with the calculator:
- Use C, ESC or Delete to clear the display;
- Use number keys, parenthesis and . to input data.
The starting point for this calculator was a workshop of programming languages hosted by Luciano Ramalho at Garoa Hacker Clube (way far from my last attempt). After watching the presentation, I've tried, unsucessfully, to read John McCarthy's paper on which this algorithm is based on (if you want to dive in, this article by Paul Graham is a more accessible introduction to McCarthy's work).
After implementing the evaluate function, I've implemented tokenizer, operators and an infix-to-prefix function (I'm not happy with this last one, therefore, it must change in the future). For the rest, is a React application started with CRA.
- Use ← or ↑ to go backwards in the input history;
- Use → or ↓ to go forward in the input history;
Feel free to contribute with the solution and give me tips and counseling to make it better :)
This project is licensed under the MIT License - see the LICENSE.md file for details