Back to General discussions forum
Make a Reverse Polish Notation. The input are some long expressions in RPN and the user has to give the correct result of every expression. The problem will teach users the concept of the stack. The idea is well documated so its not like its a magical unicorn people have to catch. K&R has a example where they make a RPN calculator in C, so there are examples of RPN in programming out there.
Hi! Thanks for your suggestion!
It seems not too hard to implement so I'll try to create such exercise. The main my concern is that if there are ready RPN calculators online, people can easily use them... Though we'll see what can be done about this... :)
Just add a special operation that’s not in the usual RPN calculators, for example an operator that reverses the entire stack (1-2-3-4-5 becomes 5-4-3-2-1) or that adds 42.
Yes, this would work (though this will make exercise more like FORTH
implementation).
The only puzzle is now how to create the test-case generator for this problem - but I'm already kicking around this and hope that soon the exercise will be ready!
Just have published the problem!
I only regret your profile does not give hint on your name so I (at least temporarily) put your handle in the line referencing the author.