Post Reply 
Tripartite Palindromic Partition of Integer (HP 50g) Challenge
03-27-2023, 08:51 AM
Post: #93
RE: Tripartite Palindromic Partition of Integer (HP 50g) Challenge
ALGO5 now smaller:

Code:
CKSUM #12287d

SIZE 769

« 1 OVER SIZE 2
IQUOT 10 OVER ^ DUP
10 / + 5 PICK OVER
- I→NL REVLIST →
num p1 mult m s d
  «
    IF d m DUP2 GET
UNROT 1 + GET *
    THEN d REVLIST
    ELSE 'mult'
INCR DROP num s 2 *
- I→NL
    END NTYPE →
type special d p1
p2 p3
    «
      CASE p1 SIZE
2 MOD
        THEN d
REVLIST DUP SIZE
OVER 2 GET PICK3 3
GET 4 PICK 4 PICK
GET 4 PICK ZEROLST
3 NDUPN DROP → n d2
d3 dn p1 p2 p3
          « REVLIST
d2 p1 1 1 PUT n 1
PUT 2 PICK3 PUT n 1
- ROT PUT CMPLST d3
            IF dn
OVER - 10 MOD
            THEN 1
- p2 3 PICK3 PUT n
ROT PUT CMPLST dn
d3 - 10 MOD p3 4
PICK3 PUT n ROT
            ELSE
HALT 2 - p2 3 PICK3
PUT n ROT PUT
CMPLST p3 4 1 PUT n
1
            END PUT
CMPLST ALGO4
          »
        END d p1 p2
p3 type HEAD "A" ==
        THEN ALGO2
        END ALGO4
      END
    » ROT s mult *
+ UNROT
  »
»
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Tripartite Palindromic Partition of Integer (HP 50g) Challenge - Gerald H - 03-27-2023 08:51 AM



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