Roman Numeral verbs in J 
Author Message
 Roman Numeral verbs in J

See the thread entitled "roman and arabic - some fun(ctions)"
initiated by Richard Levine in this forum on Friday, August 11.


Fri, 13 Mar 1998 03:00:00 GMT  
 Roman Numeral verbs in J
[This message is converted from WPS-PLUS to ASCII]

Greetings,

The other night I was helping my nine year daughter with her
math homework.  She is learning Roman numerals.
It had been years (maybe 25+) since I had done anything
with Roman numerals so it was as much a lesson for daddy
as it was for her.

While I was helping her I thought it would be fun to
write J verbs to convert positive integers to and from
roman numerals, e.g.

  NB. "arabictoroman" converts arrays of positive integers (of any rank)
  NB. to boxed roman numeral character list representations (of the same rank)

  ] x1=.  arabictoroman  3 9 13 88 1995
+---+--+----+--------+------+
|III|IX|XIII|LXXXVIII|MCMXCV|
+---+--+----+--------+------+

  ] x2=.  arabictoroman   1 + i. 2 2  NB. no zero in Roman Numerals
+---+---+
|I  |III|
+---+---+
|III|IV |
+---+---+

  NB. inverse "romantoarabic"

       romantoarabic x1
  3 9 13 88 1995

       romantoarabic x2
  1 2
  3 4

I believe this very problem was solved in this list.  If not
I'd be interested in looking at any J solutions.

John Baker



Fri, 13 Mar 1998 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Roman Numeral Verbs in J

2. Roman numeral verbs in J

3. ROMAN NUMERAL CONVERSION??

4. Haskell: roman numerals

5. ROMAN NUMERAL CONVERSION??

6. PL/I (Roman Numeral 1) as opposed to PL/1

7. Integer to Roman Numeral Conversion

8. Roman numeral conversion...

9. OT - Arithmetic with Roman Numerals

10. Roman Numerals revisited

11. Roman Numerals chart to 1,000,000

12. Roman numeral arithmetic

 

 
Powered by phpBB® Forum Software