Roman Numerals Mini Challenge

Completed Aug. 6, 2011

This challenge is all about Roman Numerals! While chatting about software interviews on IRC, someone recounted being asked to convert between roman and arabic up on the whiteboard. Let's see how everyone else does.

Write two functions:

  1. A method that will take a Roman numeral string as input and output an integer representing the value of that Roman numeral.

            "X" -> 10
            "XXIX" -> 29
            "XXXV" -> 35

  2. A method that will take an integer <= 3999 as input and output that number represented as a Roman numeral. Examples:

            10 -> "X"
            13 -> "XIII"
            52 -> "LII"

Roman Numerals on Wikipedia

We'll run the challenge until 3AM Pacific time on Saturday, so get your entries in. Points for style and creativity! Thanks to quanticle for the submission!

This challenge is now closed.


None yet!

Come Chat!

Join channel ##proggit on freenode.


Having issues with the the site? Let us know.