Rhoulhac / roman_numeral

My attempt at the roman numeral kata using Python
0 stars 0 forks source link

Doesn't work for 2000's #1

Open michael-doody opened 6 years ago

michael-doody commented 6 years ago

Is there a way to make the symbol_options dict more dynamic. This won't work for anything greater than or equal to the 3000's.

symbol_options = {
        1: {0: 'I', 1: 'X', 2: 'C', 3: 'M'},
        2: {0: 'II', 1: 'XX', 2: 'CC', 3: 'MM'},
        3: {0: 'III', 1: 'XXX', 2: 'CCC'},
        4: {0: 'IV', 1: 'XL', 2: 'CD'},
        5: {0: 'V', 1: 'L', 2: 'D'},
        6: {0: 'VI', 1: 'LX', 2: 'DC'},
        7: {0: 'VII', 1: 'LXX', 2: 'DCC'},
        8: {0: 'VIII', 1: 'LXXX', 2: 'DCCC'},
        9: {0: 'IX', 1: 'XC', 2: 'CM'},
    }
Rhoulhac commented 6 years ago

I only handled 1-1999 in keeping with the kata that I was trying to solve. But feel free to submit a PR that makes the symbol_options dict more dynamic.