Skip to content
Permalink
Browse files

8 => VIII, 80 => LXXX, 800 => DCCC

  • Loading branch information
michaelbannister committed Jul 10, 2016
1 parent 35411e9 commit 87d0c997e0680d8736559dc8c7c31ed414f0ddca
Showing with 3 additions and 3 deletions.
  1. +1 −2 src/main/kotlin/RomanNumerals.kt
  2. +2 −1 src/test/kotlin/DecimalToRomanConverterTest.kt
@@ -9,8 +9,7 @@ fun Int.toRoman(): String {
in 1..3 -> one().repeat(it.multiplier)
4 -> one() + five()
5 -> five()
6 -> five() + one()
7 -> five() + one() + one()
in 6..8 -> five() + one().repeat(it.multiplier - 5)
else -> ""
}
}.joinToString(separator = "")
@@ -34,7 +34,8 @@ class DecimalToRomanConverterTest {
arrayOf(4, "IV"),
arrayOf(444, "CDXLIV"), // again, just checking
arrayOf(666, "DCLXVI"),
arrayOf(777, "DCCLXXVII")
arrayOf(777, "DCCLXXVII"),
arrayOf(888, "DCCCLXXXVIII")
)

@Test

0 comments on commit 87d0c99

Please sign in to comment.
You can’t perform that action at this time.