Post Reply 
HHC 2016 RPL Programming Contest
09-21-2016, 11:42 AM
Post: #22
RE: HHC 2016 RPL Programming Contest
(09-21-2016 12:10 AM)DavidM Wrote:  I made an attempt to translate this same algorithm to a SysRPL implementation, but the smallest I could achieve was still slightly larger than 3298's at 42.5 bytes:
Nosy gave me a handy routine you could use to get your size down to mine. At 13FD8 there is this small secondary;
Code:
:: ONE POSCHR ;
It's apparently unnamed, so I cannot guarantee that it's present on all ROM versions, but I'd expect most people are running 2.15 by now, which is the version I found this on. So replace the two commands ONE POSCHR by the single command PTR 13FD8 and enjoy a 40-byte solution! As a bonus, you have the same option to reduce its size further at the cost of usability (removing the UNCOERCE).

(09-21-2016 12:10 AM)DavidM Wrote:  ...and with apologies to 3298
What for? I posted code on a public forum without any copyright notice, so it's meant to be read, understood, used, and modified. This wasn't quite the kind of modification I expected (that would have been some more size optimization), but it's perfectly fine. Such a little snippet isn't worth putting a copyright on anyway. You even beat my own UserRPL translation by several commands.

About NIP: I think that's a Forth thing. As that's another important language in reverse polish notation, it's kind of expected RPL borrows some Forth concepts. Another example: The Forth equivalent of a FOR...NEXT is DO...LOOP, and in SysRPL they are - surprise! - written as DO...LOOP. Or even more basic, a Forth program is delimited by colon and semicolon. SysRPL just doubles the colon, possibly because on RPL.machines you usually get colons in pairs (for tagged objects).
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 - 3298 - 09-21-2016 11:42 AM



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