Permalink
Browse files

feat(XIV): failing implementation for 14

  • Loading branch information...
antonydenyer committed Nov 16, 2017
1 parent 2385106 commit 7e055fcf054b6b1c90b57e3ee3d6a25839b59141
Showing with 5 additions and 2 deletions.
  1. +2 −2 lib/roman.ex
  2. +3 −0 test/roman_test.exs
View
@@ -16,8 +16,8 @@ defmodule Roman do
to_roman(number - 5, "V")
end
def to_roman(number) when number >= 4 do
to_roman(number - 4, "IV")
def to_roman(number, roman_accumulator) when number >= 4 do
to_roman(number - 4, roman_accumulator <> "IV")
end
def to_roman(number) do
View
@@ -33,4 +33,7 @@ defmodule RomanTest do
assert Roman.to_roman(11) == "XI"
end
test "forteen is XIV" do
assert Roman.to_roman(14) == "XIV"
end
end

0 comments on commit 7e055fc

Please sign in to comment.