Kata
In this lesson, we start with a kata before we introduce the new material. With TPP, we found out that it is better to do the kata twice.
We will first work only with the material we have covered so far. We will then use the new concepts introduced in this lesson. This way, you get a chance to compare the two implementations and witness the effect of using TPP on your code.
Roman Numerals by cyber-dojo
Write a function to convert Arabic numbers to Roman numerals as best as you can, following the TDD practices we have been using.
Cyber-dojo foundation (See license): http://www.cyber-dojo.org/.
Given a positive integer number (for example, 42
), determine its Roman numeral representation as a string (for example, XLII
). You cannot write numerals like IM for 999.
Examples of Roman numerals by cyber-dojo are as follows: