Post Reply 
Programming Challenge: Palindromic Numbers on HP 50g
01-14-2018, 04:41 PM
Post: #21
RE: Programming Challenge: Palindromic Numbers on HP 50g
As the weekend draws to a close (here in Vienna) I post my attempt at answering the challenge.

The programme takes about half the time needed by NNTOK above.

The poetic name of the programme is

A002113.USR

Code:
« DUP 2. <
  IF
  THEN 0
  ELSE DUP →STR DUP
HEAD "1" SAME OVER
2. 2. SUB "0" SAME
NOT AND
    IF
    THEN TAIL DUP
SREV
    ELSE DUP TAIL
SWAP HEAD OBJ→ 1 -
DUP NOT
      IF
      THEN DROP
TAIL 9
      END
SWAP + DUP SREV
TAIL
    END + OBJ→
  END SWAP DROP
»
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Programming Challenge: Palindromic Numbers on HP 50g - Gerald H - 01-14-2018 04:41 PM



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