sadrok/RustRPNCalculator ? reverse-engineered prompt

Reverse engineered prompt

Build me a simple command line RPN calculator in Rust.

I want an interactive program where I can type numbers and then use +, -, *, /, and % to work with the last two values on a stack. It should also support a few simple commands like p to pop the top number, c to clear the stack, s to show the current stack, ? to print help, and q to quit.

Please make it feel polished and easy to use, with clear messages after each input, like showing when a number is pushed or when a result is produced. Handle common mistakes nicely, especially division by zero and trying to use an operator when there are not enough numbers on the stack. When the program exits, show the final stack.

Keep it lightweight and straightforward, just a clean terminal app that works the way a basic RPN calculator should. If you need to check current Rust docs or best practices, look them up online.

Are you gonna build this?

make sure you review the code using coderabbit

Try freeSponsored — opens CodeRabbit in a new tab