Post Reply 
HP49-HP50 Lists of combination
12-21-2022, 01:42 PM
Post: #10
RE: HP49-HP50 Lists of combination
My version of DOCOMB. Contrary to the ListExt lib version, intermediate results are not automatically wrapped up in a list, and so the calling sequence for your problem is rather

3: list
2: 4.
1: \<< 4. \->LIST \>>

Code:
@ DOCOMB 265.5 bytes #CC35h
\<<
  ROT 0
  \-> ob L DoC
  \<<
    DEPTH DEPTH ROLLD
    L SIZE
    {}
    { 3 PICK 1 -
      \-> t n
      \<<
        IF n
        THEN FOR s n s 1 - L s GET 1 \->LIST t + DoC EVAL NEXT 
        ELSE FOR s L s GET t LIST\-> DROP ob EVAL NEXT
        END
      \>>
    } DUP 'DoC' STO EVAL
    DEPTH DEPTH ROLL -
    IF DUP 0 > THEN \->LIST ELSE DROP END
  \>>
\>>

41CV†,42S,48GX,49G,DM42,DM41X,17BII,15CE,DM15L,12C,16CE
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
HP49-HP50 Lists of combination - Gil - 12-18-2022, 11:01 PM
RE: HP49-HP50 Lists of combination - Gil - 12-19-2022, 10:38 AM
RE: HP49-HP50 Lists of combination - Gil - 12-19-2022, 01:42 PM
RE: HP49-HP50 Lists of combination - Gil - 12-19-2022, 03:35 PM
RE: HP49-HP50 Lists of combination - Werner - 12-21-2022 01:42 PM



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