Skip to content

Instantly share code, notes, and snippets.

@rwarbelow
Created February 26, 2015 19:08
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rwarbelow/7ae3d2f1b3c714848e7e to your computer and use it in GitHub Desktop.
Save rwarbelow/7ae3d2f1b3c714848e7e to your computer and use it in GitHub Desktop.
  1. Write a program that can convert Arabic numbers 1-3000 to Roman numerals. For example:
converter = RomanConverter.new
converter.to_roman(6)
=> "VI"

converter.to_roman(14)
=> "XIV"
  1. Write a program that can convert Roman numerals I-MMM to Arabic numbers. For examples:
converter = RomanConverter.new
converter.to_arabic("X")
=> 10

converter.to_arabic("XXIX")
=> 29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment