just because i felt like trying, i wrote this app to translate roman numerals back and forth. no, this isnt homework. just practice.
anyway, the way i went about doing it is just (for from arabic to roman) getting the length of the string and using that as a basis to convert one decimal place at a time. simple enough.
but from roman to arabic was obviously a tad more difficult. in the end, i decided to transverse the inputed string backwards, using the add and subtract rules of roman numerals to determine the value needed and just add that value each time.
my curiousity is this: im doing it simply with a large amount of cases and ifs. this is the source file: is there some much easier way to do it? or even a more efficient way despite added complexity?
thanks.
žÅNžÅ
anyway, the way i went about doing it is just (for from arabic to roman) getting the length of the string and using that as a basis to convert one decimal place at a time. simple enough.
but from roman to arabic was obviously a tad more difficult. in the end, i decided to transverse the inputed string backwards, using the add and subtract rules of roman numerals to determine the value needed and just add that value each time.
my curiousity is this: im doing it simply with a large amount of cases and ifs. this is the source file: is there some much easier way to do it? or even a more efficient way despite added complexity?
thanks.
žÅNžÅ