/solirius-code-challenge

Coding Challenge

Primary LanguageJavaScript

solirius-code-challenge

Coding Challenge

.
├── node
|   ├── index.js
│   └── tests
|       └── romanNumeralGenerator.spec.js
├── web
│   └── index.html
└── romanNumeralGenerator.js

romanNumeralGenerator.js

This is the main function. It takes a number value and outputs roman string.
The function works by storing an array of units, tens, hundreds & thousands.
It will then loop through the int and calculate the index for each unit.
It uses modulo operator and division to slice the integer.

Node

Prerequisites

npm install

To run node application just run

npm start

The node application will ask you to enter a number within the terminal.
Enter the number you wish to convert and press the RETURN key.
The roman value will then print on the next line.

image

Tests

Tests are implemented using jest. To run tests run the command below:

npm tests

Web

Open index.html to load web page. Enter value in input and the roman number should apear. you might have to click off of the input for the event to register.

image