From d097cbc356dbf557b88fe8b417c003305c627f74 Mon Sep 17 00:00:00 2001 From: Muhammed Mustafa Date: Wed, 22 Jun 2022 09:10:11 +0200 Subject: [PATCH] fix(curriculum): external comma external link in CIP (#46388) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix(curriculum): external comma link in CIP * Removed blog text * Changed the output and the input * swapped list/squence to an array * added a little description * Add spaced Co-authored-by: Jeremy L Thompson * Shaun got our back part 1 Co-authored-by: Shaun Hamilton * Shaun got our back part 2 Co-authored-by: Shaun Hamilton * Shaun got our back part 3💚 Co-authored-by: Shaun Hamilton * Typo fix Co-authored-by: Tom <20648924+moT01@users.noreply.github.com> * reverted the variables * Update comma-quibbling.md * Goodbye table, I fought hard for you * Nice catch 👍 * fix: solution Co-authored-by: Jeremy L Thompson Co-authored-by: Shaun Hamilton Co-authored-by: Tom <20648924+moT01@users.noreply.github.com> --- .../rosetta-code/comma-quibbling.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/curriculum/challenges/english/10-coding-interview-prep/rosetta-code/comma-quibbling.md b/curriculum/challenges/english/10-coding-interview-prep/rosetta-code/comma-quibbling.md index 6223a523cee..305134766ac 100644 --- a/curriculum/challenges/english/10-coding-interview-prep/rosetta-code/comma-quibbling.md +++ b/curriculum/challenges/english/10-coding-interview-prep/rosetta-code/comma-quibbling.md @@ -8,7 +8,7 @@ dashedName: comma-quibbling # --description-- -Comma quibbling is a task originally set by Eric Lippert in his [blog](https://blogs.msdn.com/b/ericlippert/archive/2009/04/15/comma-quibbling.aspx). +[Comma quibbling](https://rosettacode.org/wiki/Comma_quibbling) is a task originally set by Eric Lippert in his 2009 blog. In this challenge, you will create a `string` from an `array`. You have to account for the `array` having no items, a single item, or multiple items in it. # --instructions-- @@ -52,19 +52,19 @@ assert(typeof quibble(['ABC']) === 'string'); assert.equal(quibble(testCases[0]), results[0]); ``` -`quibble(["ABC"])` should return "{ABC}". +`quibble(["ABC"])` should return `"{ABC}"`. ```js assert.equal(quibble(testCases[1]), results[1]); ``` -`quibble(["ABC", "DEF"])` should return "{ABC and DEF}". +`quibble(["ABC", "DEF"])` should return `"{ABC and DEF}"`. ```js assert.equal(quibble(testCases[2]), results[2]); ``` -`quibble(["ABC", "DEF", "G", "H"])` should return "{ABC,DEF,G and H}". +`quibble(["ABC", "DEF", "G", "H"])` should return `"{ABC, DEF, G and H}"`. ```js assert.equal(quibble(testCases[3]), results[3]); @@ -76,7 +76,7 @@ assert.equal(quibble(testCases[3]), results[3]); ```js const testCases = [[], ["ABC"], ["ABC", "DEF"], ["ABC", "DEF", "G", "H"]]; -const results = ["{}", "{ABC}", "{ABC and DEF}", "{ABC,DEF,G and H}"]; +const results = ["{}", "{ABC}", "{ABC and DEF}", "{ABC, DEF, G and H}"]; ``` ## --seed-contents-- @@ -93,7 +93,7 @@ function quibble(words) { ```js function quibble(words) { return "{" + - words.slice(0, words.length - 1).join(",") + + words.slice(0, words.length - 1).join(", ") + (words.length > 1 ? " and " : "") + (words[words.length - 1] || '') + "}";