Skip to content

Commit

Permalink
remove old code
Browse files Browse the repository at this point in the history
  • Loading branch information
vapidbabble committed Sep 2, 2015
1 parent 5351197 commit c7e60d7
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 29 deletions.
1 change: 1 addition & 0 deletions README.md
Expand Up @@ -8,3 +8,4 @@ need to:

1. remove convert_to_arabic_old
2. added error_handling?
3. move code to lib?
22 changes: 0 additions & 22 deletions roman.rb
Expand Up @@ -29,28 +29,6 @@ def convert_to_roman(arabic)
roman
end

def convert_to_arabic_old(str)
arabic=0
myind=0
edge=false
str.each_char do |ele|
if edge
edge=false
myind+=1
next
end
value=@romanlist[ele]
substr=str.slice(myind,2)
if (substr.length == 2) && (value < @romanlist[substr[1]])
value=@romanlist[substr]
edge=true
end
myind+=1
arabic+=value
end
arabic
end

def convert_to_arabic(str)
arabic=0
@romanlist.each do |rsymbol,num|
Expand Down
7 changes: 0 additions & 7 deletions test_roman.rb
Expand Up @@ -13,13 +13,6 @@ def test_to_roman
assert_equal "MMMMMMDCCLXXXIX", @convert.convert_to_roman(6789)
end

def test_to_arabic_old
assert_equal @convert.convert_to_arabic_old("VIII"), 8
assert_equal @convert.convert_to_arabic_old("XLIX"), 49
assert_equal @convert.convert_to_arabic_old("MMXV"), 2015
assert_equal @convert.convert_to_arabic_old("MMMMMMDCCLXXXIX"), 6789
end

def test_to_arabic
assert_equal @convert.convert_to_arabic("VIII"), 8
assert_equal @convert.convert_to_arabic("XLIX"), 49
Expand Down

0 comments on commit c7e60d7

Please sign in to comment.