From 13938536f6ce88cbf5e9b568aeacd7b2ff211272 Mon Sep 17 00:00:00 2001 From: kaufm <62788609+kaufm@users.noreply.github.com> Date: Tue, 3 Aug 2021 10:32:28 +0200 Subject: [PATCH 1/4] Update Create-PullRequest.md --- ch3_pull-request/Create-PullRequest.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ch3_pull-request/Create-PullRequest.md b/ch3_pull-request/Create-PullRequest.md index 3cd961b2..b9240ecd 100644 --- a/ch3_pull-request/Create-PullRequest.md +++ b/ch3_pull-request/Create-PullRequest.md @@ -6,15 +6,15 @@ 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 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_: From 961c49394670dcd5688a290a7ad14e28bd64187d Mon Sep 17 00:00:00 2001 From: kaufm <62788609+kaufm@users.noreply.github.com> Date: Tue, 3 Aug 2021 10:46:19 +0200 Subject: [PATCH 2/4] Update Create-PullRequest.md --- ch3_pull-request/Create-PullRequest.md | 1 + 1 file changed, 1 insertion(+) diff --git a/ch3_pull-request/Create-PullRequest.md b/ch3_pull-request/Create-PullRequest.md index b9240ecd..6050bef1 100644 --- a/ch3_pull-request/Create-PullRequest.md +++ b/ch3_pull-request/Create-PullRequest.md @@ -11,6 +11,7 @@ In Chapter 3 - _Teamwork and Collaborative Development_ we learn how to collabo Add random text a new line + Add another line 4. Modify the following line by removing the letters that do not belong: From 03d8410fcf871d3f119cd74b43d4c48794297144 Mon Sep 17 00:00:00 2001 From: kaufm <62788609+kaufm@users.noreply.github.com> Date: Tue, 3 Aug 2021 11:18:59 +0200 Subject: [PATCH 3/4] Update app.js --- ch3_pull-request/src/app.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/ch3_pull-request/src/app.js b/ch3_pull-request/src/app.js index d2b448d1..a9672cd6 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]; From 5161736970cedef35e4b37b1e0ff5d8901f427bc Mon Sep 17 00:00:00 2001 From: kaufm <62788609+kaufm@users.noreply.github.com> Date: Tue, 3 Aug 2021 11:20:28 +0200 Subject: [PATCH 4/4] Apply suggestions from code review --- ch3_pull-request/src/app.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ch3_pull-request/src/app.js b/ch3_pull-request/src/app.js index a9672cd6..f45636c4 100644 --- a/ch3_pull-request/src/app.js +++ b/ch3_pull-request/src/app.js @@ -3,10 +3,10 @@ function toRomanNumerals(num) { var roman = ''; var i; for ( i in lookup ) { - while ( num >= lookup[i] ) { - roman += i; - num -= lookup[i]; - } + while ( num >= lookup[i] ) { + roman += i; + num -= lookup[i]; + } } return roman;