Skip to content

Commit

Permalink
feat(XIV): failing implementation for 14
Browse files Browse the repository at this point in the history
  • Loading branch information
antonydenyer committed Nov 16, 2017
1 parent 2385106 commit 7e055fc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/roman.ex
Expand Up @@ -16,8 +16,8 @@ defmodule Roman do
to_roman(number - 5, "V") to_roman(number - 5, "V")
end end


def to_roman(number) when number >= 4 do def to_roman(number, roman_accumulator) when number >= 4 do
to_roman(number - 4, "IV") to_roman(number - 4, roman_accumulator <> "IV")
end end


def to_roman(number) do def to_roman(number) do
Expand Down
3 changes: 3 additions & 0 deletions test/roman_test.exs
Expand Up @@ -33,4 +33,7 @@ defmodule RomanTest do
assert Roman.to_roman(11) == "XI" assert Roman.to_roman(11) == "XI"
end end


test "forteen is XIV" do
assert Roman.to_roman(14) == "XIV"
end
end end

0 comments on commit 7e055fc

Please sign in to comment.