Skip to main content
1 of 2
Adám
  • 31.1k
  • 44
  • 77

###NB: work in progress

Convert MADBACE to DECIMAL

MADBACE is a mixed Roman-hexdecimal system. Hexadecimal digits (0-F) take their normal positional values, while Roman numerals (IVXLCDM) have their normal values (1 5 10 50 100 500 1000). The main parts of the challenge is to determine when to subtract and when C and D are Roman versus hexadecimal.

###Rules

  1. C and D will be Roman if possible.

  2. There can never be more than one subtractive symbol to the left of any symbol.

  3. A subtractive symbol must be less than half the symbol it subtracts from

###Examples

CM900

MC1100

MD1500

DM792 1000-13×161

LD450

CD400

XD40

ID49 13×160-1

3C52 100-3×161

4C76 4×161+12×160

MADBACE701590 (10×165-1000)+(11×163-500)+10×162+100+14×160

DECIMAL233571513 13×166+14×165+12×164+(1000-1)+10×161+50

Adám
  • 31.1k
  • 44
  • 77