Post Reply 
HHC 2016 RPN contest is now live
09-20-2016, 04:00 PM
Post: #20
RE: HHC 2016 RPN contest is now live
(09-19-2016 09:19 PM)Paul Dale Wrote:  Steps 13 and 14 in my original program are not required -- I forgot how the Sigma function takes it arguments Sad Combine this with the earlier one step saving and my solution is down to 29 steps.

Kudos for the formula! Here is a slightly modified version of your solution with one step and one register less: 29 steps including the END and using 3 registers (I,J,K) instead of 4 (J,K,00,01), still a bit longer than my brute force solution (2 steps and 1 register more) but much much more faster !

Code:
01:        [cplx]STO J
02:        XEQ a
03:        DEC K
04:        XEQ a
05:        RCL- I
06:        RTN    
        
07:   a::  [cplx]RCL J
08:        SDR 001
09:        IP
10:        MIN
11:        [Sigma] 00
12:        x<> I
13:        RTN
        
14:        LBL 00
15:        (-1)[^x]
16:        RCL K
17:        RCL Z
18:        COMB
19:        *
20:        RCL J
21:        # 010
22:        RCL* T
23:        -
24:        RCL K
25:        DEC X
26:        STO+ Y
27:        COMB
28:        *
29:        END
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
HHC 2016 RPN contest is now live - Gene - 09-17-2016, 01:36 PM
RE: HHC 2016 RPN contest is now live - Didier Lachieze - 09-20-2016 04:00 PM



User(s) browsing this thread: 2 Guest(s)