Post Reply 
HHC 2015 RPN programming Contest is now open
09-28-2015, 12:53 AM (This post was last modified: 09-28-2015 01:33 AM by Egan Ford.)
Post: #23
RE: HHC 2015 RPN programming Contest is now open
HP 41C
40 Bytes
26 Lines

Code:

  1 LBL RR                  ; 11 SigmaREG required?
  2 CL Sigma                ; count numbers in sequence
  3 6                       ; search for 6, 5, 4, 3, 2, 1 loop
  4 STO 07
  5 LBL 07
  6     5                   ; search each dice
  7     STO 06
  8     LBL 06
  9         RCL 07          ; outer loop
 10         RCL IND 06      ; inner loop
 11         x=y?            ; is there a match?
 12         GTO 09          ; if so, break out of here
 13     DSE 06
 14     GTO 06
 15     CL Sigma            ; no match, reset sequence counter
 16     LBL 09
 17     x=y?                ; got match
 18     Sigma+              ; inc sequence counter
 19     RCL 16              ; recall n
 20     4
 21     -
 22     x=0?                ; got 4 in a row?
 23     STOP                ; then stop with X = 0
 24 DSE 07
 25 GTO 07
 26 END                     ; X = non-zero
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: HHC 2015 RPN programming Contest is now open - Egan Ford - 09-28-2015 12:53 AM



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