HHC 2015 RPN programming Contest is now open
|
10-15-2015, 12:19 PM
Post: #100
|
|||
|
|||
RE: HHC 2015 RPN programming Contest is now open
(09-29-2015 09:25 AM)Werner Wrote: Managed to squeeze off a byte: As I stated elsewhere, in my opinion your program is quite brilliant. It took me a little while to figure out what you were doing, what the heck the LOG, FRC and SIGN instructions could possibly have to do with this problem. But after walking through it a time or two (or three), I was able to see the method you used, which is quite clever. Then I thought I saw a simple improvement, put the RCL 5 in the loop to build the sum, like this: Code:
That is indeed one step shorter, but due to the need to enter the 0 ahead of the summing loop, the byte count is the same. More elegant to start the sum with one of the values to be summed (10^register 5) and then sum the rest than to start at zero. For the same byte count, I’ll take elegance over step count. Other similar rearrangements yielded 25 steps, but higher byte counts, so I think your code is optimal. Again, very nice work! Dave - My mind is going - I can feel it. |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 2 Guest(s)