|
1 | | -# Instructions |
| 1 | +# Introduction |
2 | 2 |
|
3 | | -Write a function to convert from normal numbers to Roman Numerals. |
| 3 | +Your task is to convert a number from Arabic numerals to Roman numerals. |
4 | 4 |
|
5 | | -The Romans were a clever bunch. |
6 | | -They conquered most of Europe and ruled it for hundreds of years. |
7 | | -They invented concrete and straight roads and even bikinis. |
8 | | -One thing they never discovered though was the number zero. |
9 | | -This made writing and dating extensive histories of their exploits slightly more challenging, but the system of numbers they came up with is still in use today. |
10 | | -For example the BBC uses Roman numerals to date their programs. |
| 5 | +For this exercise, we are only concerned about traditional Roman numerals, in which the largest number is MMMCMXCIX (or 3,999). |
11 | 6 |
|
12 | | -The Romans wrote numbers using letters - I, V, X, L, C, D, M. |
13 | | -(notice these letters have lots of straight lines and are hence easy to hack into stone tablets). |
| 7 | +~~~~exercism/note |
| 8 | +There are lots of different ways to convert between Arabic and Roman numerals. |
| 9 | +We recommend taking a naive approach first to familiarise yourself with the concept of Roman numerals and then search for more efficient methods. |
14 | 10 |
|
15 | | -```text |
16 | | - 1 => I |
17 | | -10 => X |
18 | | - 7 => VII |
19 | | -``` |
20 | | - |
21 | | -The maximum number supported by this notation is 3,999. |
22 | | -(The Romans themselves didn't tend to go any higher) |
23 | | - |
24 | | -Wikipedia says: Modern Roman numerals ... are written by expressing each digit separately starting with the left most digit and skipping any digit with a value of zero. |
25 | | - |
26 | | -To see this in practice, consider the example of 1990. |
27 | | - |
28 | | -In Roman numerals 1990 is MCMXC: |
29 | | - |
30 | | -1000=M |
31 | | -900=CM |
32 | | -90=XC |
33 | | - |
34 | | -2008 is written as MMVIII: |
35 | | - |
36 | | -2000=MM |
37 | | -8=VIII |
38 | | - |
39 | | -Learn more about [Roman numerals on Wikipedia][roman-numerals]. |
40 | | - |
41 | | -[roman-numerals]: https://wiki.imperivm-romanvm.com/wiki/Roman_Numerals |
| 11 | +Make sure to check out our Deep Dive video at the end to explore the different approaches you can take! |
| 12 | +~~~~ |
0 commit comments