Post Reply 
hp 28s - creating nested lists
02-20-2015, 02:16 AM (This post was last modified: 02-20-2015 03:26 AM by mbrethen.)
Post: #20
RE: hp 28s - creating nested lists
Werner,

This code has errors:
Code:
NDUPN
\<<
  -> n
  \<<
    1 2 n
    FOR i
      DUPN i DUP
    STEP
    n - DUP 0 <
    { NEG DUPN }
    { DROPN }
    IFTE
    n
  \>>
\>>

Initially the error traces back to the FOR statement, so I removed the '2'. Then it gives an error on DUPN. I gave up at this point.

This does work:
Code:
NDUPN
\<< 0. OVER START OVER SWAP NEXT ROT ROT DROP2 \>>
But why create a separate program when your original code works? What is the advantage (other than calling it from multiple programs)?
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
hp 28s - creating nested lists - mbrethen - 02-16-2015, 04:33 PM
RE: hp 28s - creating nested lists - mbrethen - 02-20-2015 02:16 AM



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