2 added 76 characters in body
source | link

Sed, 146 chars

:;s/M/DD/;s/D/CCCCC/;s/C/LL/;s/L/XXXXX/;s/X/VV/;s/V/IIIII/;t;s/\(I\+\)-\1/-/;:a;s/IIIII/V/;s/VV/X/;s/XXXXX/L/;s/LL/C/;s/CCCCC/D/;s/DD/M/;ta;s/-$//

This is a pure sed implementation. Input is expected to be in the following format, with no spaces

XXIIII-XXXXII

It outputs negative values correctly, and prints zeros as empty strings.

still trying to shave a bit off the code without resorting to using extended regexps

Sed, 146 chars

:;s/M/DD/;s/D/CCCCC/;s/C/LL/;s/L/XXXXX/;s/X/VV/;s/V/IIIII/;t;s/\(I\+\)-\1/-/;:a;s/IIIII/V/;s/VV/X/;s/XXXXX/L/;s/LL/C/;s/CCCCC/D/;s/DD/M/;ta;s/-$//

This is a pure sed implementation. Input is expected to be in the following format, with no spaces

XXIIII-XXXXII

still trying to shave a bit off the code without resorting to using extended regexps

Sed, 146 chars

:;s/M/DD/;s/D/CCCCC/;s/C/LL/;s/L/XXXXX/;s/X/VV/;s/V/IIIII/;t;s/\(I\+\)-\1/-/;:a;s/IIIII/V/;s/VV/X/;s/XXXXX/L/;s/LL/C/;s/CCCCC/D/;s/DD/M/;ta;s/-$//

This is a pure sed implementation. Input is expected to be in the following format, with no spaces

XXIIII-XXXXII

It outputs negative values correctly, and prints zeros as empty strings.

still trying to shave a bit off the code without resorting to using extended regexps

1
source | link

Sed, 146 chars

:;s/M/DD/;s/D/CCCCC/;s/C/LL/;s/L/XXXXX/;s/X/VV/;s/V/IIIII/;t;s/\(I\+\)-\1/-/;:a;s/IIIII/V/;s/VV/X/;s/XXXXX/L/;s/LL/C/;s/CCCCC/D/;s/DD/M/;ta;s/-$//

This is a pure sed implementation. Input is expected to be in the following format, with no spaces

XXIIII-XXXXII

still trying to shave a bit off the code without resorting to using extended regexps