Post Reply 
Mini-Challenge: Rudin-Shapiro Sequence
12-18-2022, 08:30 PM
Post: #17
RE: Mini-Challenge: Rudin-Shapiro Sequence
(12-16-2022 10:41 PM)John Keith Wrote:  
Code:

\<< { 1 } DUP ROT 2 SWAP   @ Do n-1 iterations
  START DUP2 + ROT ROT     @ Concatenate and move to top
    0 SWAP - +             @ Negate second part and concatenate
  NEXT +                   @ Concatenate last two lists
\>>

Some nice programming! I just noticed you can save 10% (5 bytes) of the program size by using the NEG function rather than "0 SWAP -"

(50 bytes)
Code:

\<< { 1 } DUP ROT 2 SWAP   @ Do n-1 iterations
  START DUP2 + ROT ROT     @ Concatenate and move to top
    NEG +                       @ NEG-ate second part and concatenate
  NEXT +                    @ Concatenate last two lists
\>>

17bii | 32s | 32sii | 41c | 41cv | 41cx | 42s | 48g | 48g+ | 48gx | 50g | 30b

Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Mini-Challenge: Rudin-Shapiro Sequence - Allen - 12-18-2022 08:30 PM



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