More a curiosity than a challenge... Message #1 Posted by Vieira, Luiz C. (Brazil) on 10 Mar 2003, 6:14 a.m.
Hi;
One curiosity (or chalenge): given three numbers A, B and C in the stack (X, Y and Z registers) what's the shortest way to get (A+B+C), A, B and C in any order in the stack by using only the stack registers and stack manipulations? Before After or or or...
X A A A+B+C A
Y B B A A+B+C
Z C C B 
T  A+B+C  C
L   C B
I know an easy way with the HP42S: ENTER
RCL  ST Z
RCL  ST T
or in an HP41: ENTER
R^ (ROLLUP)
ST+ Y
R^ (ROLLUP)
ST+ Z
but I would like to know the shortest way to do it in, say, a Voyager, or in an HP32SII, or in an HP12C. Restrictions are the calculator's resources themselves. Any clues?
This is intented to activate some standby, RPNmode, stacksimulation areas of contributors' brains. And, of course, I want to know a better, shortest way to do it.
Hope you like it.
Luiz C. Vieira  Brazil
