Skip to content

Latest commit

 

History

History
28 lines (18 loc) · 499 Bytes

File metadata and controls

28 lines (18 loc) · 499 Bytes

RomaJS Codemotion Code Competition 2014

Write a function that takes a Roman numeral and returns a decimal number, i.e.

input: IV output: 4

input: XI output: 11

The algorithm is as follows: if the number is followed by a larger number, its value is subtracted, else it is added.

Install

npm install

Run the tests

npm test

npm run test-dev # run the tests with a watcher

Winner is who:

  • passes tests
  • is fast
  • writes elegant code