tags: calculator, challenge

Action executed in 0.000

Challenge1: Stack, Express Evaluation Submission

I got the logic working last week and finally cleaned up input and output for my submission to my challenge. The executable is 19,394 bytes.

One caveat: the internal data type for numbers is an int. So there are problems with precision on division.

The main function solve() is recursive, but really doesn't have to be.

The source code is here.

Stack, Expression Evaluation Challenge

Implement a stack. Use it to evaluate a simple mathematical expression. This expression will not have parentheses. It will use only plus, minus, multiply, and divide operators. The operands (input) will be integers, although output may be rational due to division. You may or may not use recursion. All code must be written by you.

Of course i'd like to see recursion. But if you think that's impossible then don't. When you see my example you will be proven wrong.

You swap out a stack for another data structure, but once again, don't wimp out.

Any code that is not used is seen wasteful and a bore to my eyes.