Post Reply 
[SOLVED] DSRN (dog slow roman numerals)
06-13-2014, 11:19 AM (This post was last modified: 06-13-2014 12:43 PM by Dave Britten.)
Post: #18
RE: DSRN (dog slow roman numerals)
(06-13-2014 08:12 AM)Thomas Klemm Wrote:  
(06-13-2014 01:01 AM)DavidM Wrote:  I did finally find a way to shoehorn a DOLIST (and a sigmaLIST) into the mix.

Very nice! My only suggestion is to use a local variable L for the list. This makes the FOR-loop simpler:
Code:
\<<
  { 1000 900 500 400 100 90 50 40 10 9 5 4 1 } \-> L
  \<<
    { } SWAP
    1 13 FOR n
      L n GET
      IDIV2 UNROT + SWAP
    NEXT
    DROP
  \>>
  { "M" "CM" "D" "CD" "C" "XC" "L" "XL" "X" "IX" "V" "IV" "I" } SWAP
  2 \<< NDUPN DROP \>> DOLIST
  \GSLIST
\>>

However I can't test this at the moment.

Cheers
Thomas

Very nice. IDIV2 isn't present on the 48, however. I think that was new on the 49. You could probably get away with some combination of DUP2/MOD/IP since this program would only need to deal with positive numbers.

EDIT: Simple numeric IDIV2 replacement for anybody that wants to run it on a 48.

Code:
\<< DUP2 / FLOOR SWAP OVER * ROT SWAP - \>>
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: DSRN (dog slow roman numerals) - HP67 - 06-11-2014, 07:06 PM
RE: DSRN (dog slow roman numerals) - HP67 - 06-12-2014, 11:44 AM
RE: DSRN (dog slow roman numerals) - HP67 - 06-12-2014, 04:49 PM
RE: DSRN (dog slow roman numerals) - HP67 - 06-15-2014, 12:02 PM
RE: DSRN (dog slow roman numerals) - HP67 - 06-16-2014, 06:09 AM
RE: DSRN (dog slow roman numerals) - HP67 - 06-12-2014, 05:46 PM
RE: DSRN (dog slow roman numerals) - Dave Britten - 06-13-2014 11:19 AM



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