diff --git a/ch3_pull-request/Create-PullRequest.md b/ch3_pull-request/Create-PullRequest.md index 3cd961b2..6050bef1 100644 --- a/ch3_pull-request/Create-PullRequest.md +++ b/ch3_pull-request/Create-PullRequest.md @@ -6,15 +6,16 @@ In Chapter 3 - _Teamwork and Collaborative Development_ we learn how to collabo 2. Delete the following line: - __Delete this line__ 3. Add one or two lines here with a random text: - __...__ + Add random text + a new line + Add another line 4. Modify the following line by removing the letters that do not belong: - __---> The ccow jumpedd ovverr thhe mooon__ + __---> The cow jumped over the moon__ 5. Commit your changes into a new _branch_: diff --git a/ch3_pull-request/src/app.js b/ch3_pull-request/src/app.js index d2b448d1..f45636c4 100644 --- a/ch3_pull-request/src/app.js +++ b/ch3_pull-request/src/app.js @@ -1,5 +1,15 @@ function toRomanNumerals(num) { - return num; + var lookup = { M:1000,CM:900,D:500,CD:400,C:100,XC:90,L:50,XL:40,X:10,IX:9,V:5,IV:4,I:1 }; + var roman = ''; + var i; + for ( i in lookup ) { + while ( num >= lookup[i] ) { + roman += i; + num -= lookup[i]; + } + } + return roman; + } var numbers = [3,4,5,13,42,2021];