HHC 2021 Programming Contests - Surprise !
|
10-18-2021, 05:42 PM
Post: #35
|
|||
|
|||
RE: HHC 2021 Programming Contests - Surprise !
(10-06-2021 05:35 PM)Werner Wrote: Just finished my RPN program using the exact same algorithm Dave just explained ;-) Hi Werner, Being an RPN implementation of Dave's method, I was curious about how you did it in fewer steps and bytes than my effort. Of course doing it stack-only helps, eliminating byte- and step-wasting stores and recalls. I'm lazy and usually just store and recall things in registers. (After I get a working program, sometimes I go back and actually see where things go in the stack and try to devise ways to eliminate the use of registers, but have not (yet) done so with my program.) I have not fully dissected your program, but upon loading and running, I did notice that it seems to fail on the "all nine(s)" cases, e.g., entering 9 should yield 11, 99 should give 101, etc. Unless I mis-entered your program, it gives 101 for 9, 1001 for 99, etc. I'm in no way criticizing your effort, your code for these challenges always strike me as marvels of efficiency and cleverness. I assume you simply did not consider these cases. I found them kind of annoying, and handling them was the last thing I added to mine after getting the basic routine to work. I'd be interested in seeing your approach to handling all nine(s) if you care to spend any more time on this problem, which I will understand if you do not. Jeff Dave - My mind is going - I can feel it. |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 7 Guest(s)