-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathroman_numerals.js
32 lines (28 loc) · 1.03 KB
/
roman_numerals.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
function to_roman_old (num) {
// your implementation code here
}
function to_roman (num) {
// your implementation code here
}
// Drive code
console.log('My totally sweet testing script\n')
console.log('input | expected | actual')
console.log('———|—————|———')
console.log('4 | IIII | ', to_roman_old(4))
console.log('9 | VIIII | ', to_roman_old(9))
console.log('13 | XIII | ', to_roman_old(13))
console.log('55 | LV | ', to_roman_old(55))
console.log('1453 | MCDLIII | ', to_roman_old(1453))
console.log('1646 | MDCXLVI | ', to_roman_old(1646))
console.log('My totally sweet testing script for new roman\n')
console.log('input | expected | actual')
console.log('———|—————|———')
console.log('4 | IV | ', to_roman(4))
console.log('9 | IX | ', to_roman(9))
console.log('13 | XIII | ', to_roman(13))
console.log('1453 | MCDLIII | ', to_roman(1453))
console.log('1646 | MDCXLVI | ', to_roman(1646))
module.exports = {
to_roman_old,
to_roman
}