From f0f4e85cb05957e32f2c4e1603b2ea1a60649989 Mon Sep 17 00:00:00 2001 From: letalumil Date: Sun, 15 Feb 2015 04:50:47 +0300 Subject: [PATCH 1/3] Fix 'Chunky Monkey' bonfire EntryPoint typo --- seed_data/bonfires.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/seed_data/bonfires.json b/seed_data/bonfires.json index 869df527a0..9d8bbbbcdf 100644 --- a/seed_data/bonfires.json +++ b/seed_data/bonfires.json @@ -172,7 +172,7 @@ "description": [ "Write a function that splits an array (first argument) into groups the length of size (second argument) and returns them as a multidimensional array." ], - "challengeSeed": "function chunk(arr, size) {\n // Break it up.\r\n return arr;\r\n}\n\nchunk((['a', 'b', 'c', 'd'], 2));", + "challengeSeed": "function chunk(arr, size) {\n // Break it up.\r\n return arr;\r\n}\n\nchunk(['a', 'b', 'c', 'd'], 2);", "tests": [ "assert.deepEqual(chunk(['a', 'b', 'c', 'd'], 2), [['a', 'b'], ['c', 'd']], 'should return chunked arrays');", "assert.deepEqual(chunk([0, 1, 2, 3, 4, 5], 3), [[0, 1, 2], [3, 4, 5]], 'should return chunked arrays');", From a2d66b4b96e42214b4a798c6bdf43c89faa1bf63 Mon Sep 17 00:00:00 2001 From: letalumil Date: Sun, 15 Feb 2015 04:51:52 +0300 Subject: [PATCH 2/3] Fix 'Slasher Flick' bonfire seed function signature --- seed_data/bonfires.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/seed_data/bonfires.json b/seed_data/bonfires.json index 9d8bbbbcdf..0b80761795 100644 --- a/seed_data/bonfires.json +++ b/seed_data/bonfires.json @@ -186,7 +186,7 @@ "description": [ "Return the remaining elements of an array after chopping off n elements from the head." ], - "challengeSeed": "function slasher(arr) {\n // it doesn't allways pay to be first\r\n return arr;\r\n}\n\nslasher([1, 2, 3], 2);", + "challengeSeed": "function slasher(arr, howMany) {\n // it doesn't allways pay to be first\r\n return arr;\r\n}\n\nslasher([1, 2, 3], 2);", "tests": [ "assert.deepEqual(slasher([1, 2, 3], 2), [3], 'should drop the first two elements');", "assert.deepEqual(slasher([1, 2, 3], 0), [1, 2, 3], 'should return all elements when n < 1');", From 0e377c572829061d2b0cd3c9b5c4df8d73697a9d Mon Sep 17 00:00:00 2001 From: letalumil Date: Sun, 15 Feb 2015 04:54:56 +0300 Subject: [PATCH 3/3] Fix 'Where art thou' bonfire. Fixes #96 --- seed_data/bonfires.json | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/seed_data/bonfires.json b/seed_data/bonfires.json index 0b80761795..933e0de778 100644 --- a/seed_data/bonfires.json +++ b/seed_data/bonfires.json @@ -208,6 +208,20 @@ "assert.deepEqual(bouncer([false, null, 0]), [], 'should return empty array if all elements are falsey');" ] }, + { + "_id":"a8e512fbe388ac2f9198f0fa", + "name":"Where art thou", + "difficulty":"1.55", + "description":[ + "Make a function that looks through a list (first argument) and returns an array of all objects that have equivalent property values (second argument)." + ], + "challengeEntryPoint":"where([{ first: 'Romeo', last: 'Montague' }, { first: 'Mercutio', last: null }, { first: 'Tybalt', last: 'Capulet' }], { last: 'Capulet' });", + "challengeSeed":"function where(collection, source) {\n var arr = [];\r\n // What's in a name?\r\n return arr;\r\n}", + "tests":[ + "assert.deepEqual(where([{ first: 'Romeo', last: 'Montague' }, { first: 'Mercutio', last: null }, { first: 'Tybalt', last: 'Capulet' }], { last: 'Capulet' }), [{ first: 'Tybalt', last: 'Capulet' }], 'should return an array of objects');", + "assert.deepEqual(where([{ 'a': 1 }, { 'a': 1 }, { 'a': 1, 'b': 2 }], { 'a': 1 }), [{ 'a': 1 }, { 'a': 1 }, { 'a': 1, 'b': 2 }], 'should return with multiples');" + ] + }, { "_id":"a39963a4c10bc8b4d4f06d7e", "name":"Seek and Destroy",