Post Reply 
HHC 2016 RPL Programming Contest
09-20-2016, 03:37 AM
Post: #18
RE: HHC 2016 RPL Programming Contest
(09-19-2016 04:26 AM)Wes Loewer Wrote:  Here's my 50g entry weighing in at 76.5 bytes, but with a qualification.

Code:
\<< 
@ initialize max distance to zero
0.

@ reverse string (see note below)
OVER SREV

@ and away we go...
1. OVER SIZE
START
  TAIL
  @ putting size of remaining string here keeps track of times through loop, used in subtraction below
  LAST SIZE
  LAST HEAD
  5. PICK SWAP
  POS
  -
  ROT
  MAX
  SWAP
NEXT

@ clean up stack
DROP NIP
\>>

Notice the use of SREV which depends on lib 256 being attached. It's not clear to me whether or not this lib is attached by default. According to HLP49, on some ROMs, the lib 256 menu is attached automatically. If not, then I suppose SREV could be replaced by a SYSEVAL. ;-)

In any case, I found the exercise educational and mentally stimulating. Thanks Gene.

-wes

NIP is not on HP48G either, how then comparison can be made?
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
HHC 2016 RPL Programming Contest - Gene - 09-17-2016, 01:39 PM
RE: HHC 2016 RPL Programming Contest - RMollov - 09-20-2016 03:37 AM



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