Permalink
Browse files

feat(IV): roman numeral four

  • Loading branch information...
antonydenyer committed Nov 16, 2017
1 parent 18d663c commit 9dcb82d840fd9809d4943a08c9ad9540b931697a
Showing with 6 additions and 0 deletions.
  1. +3 −0 lib/roman.ex
  2. +3 −0 test/roman_test.exs
View
@@ -1,5 +1,8 @@
defmodule Roman do
def to_roman(number) when number == 4 do
"IV"
end
def to_roman(number) do
String.duplicate("I", number)
end
View
@@ -11,5 +11,8 @@ defmodule RomanTest do
assert Roman.to_roman(2) == "II"
end
test "four is IV" do
assert Roman.to_roman(4) == "IV"
end
end

0 comments on commit 9dcb82d

Please sign in to comment.