From 01e408d48c8806fc0a92e9245dbc0abfc8f80436 Mon Sep 17 00:00:00 2001 From: Quincy Larson Date: Wed, 5 Aug 2015 11:57:58 -0700 Subject: [PATCH] new final-ish curriculum structure --- seed/challenges/advanced-bonfires.json | 295 ++----- seed/challenges/angularjs.json | 2 +- .../automated-testing-and-debugging.json | 6 + seed/challenges/basejumps.json | 2 +- seed/challenges/basic-bonfires.json | 815 +----------------- seed/challenges/basic-javascript.json | 2 +- seed/challenges/basic-ziplines.json | 2 +- seed/challenges/expert-bonfires.json | 304 +++++++ seed/challenges/functional-programming.json | 34 - seed/challenges/git.json | 2 +- seed/challenges/intermediate-bonfires.json | 800 +++++++++++++++-- seed/challenges/intermediate-ziplines.json | 2 +- seed/challenges/mongodb.json | 2 +- seed/challenges/nodejs-and-expressjs.json | 2 +- ...-oriented-and-functional-programming.json} | 32 +- 15 files changed, 1155 insertions(+), 1147 deletions(-) create mode 100644 seed/challenges/automated-testing-and-debugging.json create mode 100644 seed/challenges/expert-bonfires.json delete mode 100644 seed/challenges/functional-programming.json rename seed/challenges/{object-oriented-programming.json => object-oriented-and-functional-programming.json} (74%) diff --git a/seed/challenges/advanced-bonfires.json b/seed/challenges/advanced-bonfires.json index 7aa5d85777..093580e24f 100644 --- a/seed/challenges/advanced-bonfires.json +++ b/seed/challenges/advanced-bonfires.json @@ -1,55 +1,46 @@ { "name": "Advanced Algorithm Scripting", - "order": 0.011, + "order": 0.010, "challenges": [ { - "id": "aff0395860f5d3034dc0bfc9", - "name": "Bonfire: Validate US Telephone Numbers", - "dashedName": "bonfire-validate-us-telephone-numbers", - "difficulty": "4.01", + "id": "a2f1d72d9b908d0bd72bb9f6", + "name": "Bonfire: Make a Person", + "dashedName": "bonfire-make-a-person", + "difficulty": "3.01", "description": [ - "Return true if the passed string is a valid US phone number", - "The user may fill out the form field any way they choose as long as it is a valid US number. The following are all valid formats for US numbers:", - "555-555-5555, (555)555-5555, (555) 555-5555, 555 555 5555, 5555555555, 1 555 555 5555", - "For this challenge you will be presented with a string such as \"800-692-7753\" or \"8oo-six427676;laskdjf\". Your job is to validate or reject the US phone number based on any combination of the formats provided above. The area code is required. If the country code is provided, you must confirm that the country code is \"1\". Return true if the string is a valid US phone number; otherwise false.", + "Fill in the object constructor with the methods specified in the tests.", + "Those methods are getFirstName(), getLastName(), getFullName(), setFirstName(first), setLastName(last), and setFullName(firstAndLast).", + "All functions that take an argument have an arity of 1, and the argument will be a string.", + "These methods must be the only available means for interacting with the object.", "Remember to use RSAP if you get stuck. Try to pair program. Write your own code." ], - "tests": [ - "expect(telephoneCheck(\"555-555-5555\")).to.be.a(\"boolean\");", - "assert.deepEqual(telephoneCheck(\"1 555-555-5555\"), true);", - "assert.deepEqual(telephoneCheck(\"1 (555) 555-5555\"), true);", - "assert.deepEqual(telephoneCheck(\"5555555555\"), true);", - "assert.deepEqual(telephoneCheck(\"555-555-5555\"), true);", - "assert.deepEqual(telephoneCheck(\"(555)555-5555\"), true);", - "assert.deepEqual(telephoneCheck(\"1(555)555-5555\"), true);", - "assert.deepEqual(telephoneCheck(\"1 555 555 5555\"), true);", - "assert.deepEqual(telephoneCheck(\"555-555-5555\"), true);", - "assert.deepEqual(telephoneCheck(\"1 456 789 4444\"), true);", - "assert.deepEqual(telephoneCheck(\"123**&!!asdf#\"), false);", - "assert.deepEqual(telephoneCheck(\"55555555\"), false);", - "assert.deepEqual(telephoneCheck(\"(6505552368)\"), false);", - "assert.deepEqual(telephoneCheck(\"2 (757) 622-7382\"), false);", - "assert.deepEqual(telephoneCheck(\"0 (757) 622-7382\"), false);", - "assert.deepEqual(telephoneCheck(\"-1 (757) 622-7382\"), false);", - "assert.deepEqual(telephoneCheck(\"2 757 622-7382\"), false);", - "assert.deepEqual(telephoneCheck(\"10 (757) 622-7382\"), false);", - "assert.deepEqual(telephoneCheck(\"27576227382\"), false);", - "assert.deepEqual(telephoneCheck(\"(275)76227382\"), false);", - "assert.deepEqual(telephoneCheck(\"2(757)6227382\"), false);", - "assert.deepEqual(telephoneCheck(\"2(757)622-7382\"), false);" - ], "challengeSeed": [ - "function telephoneCheck(str) {", - " // Good luck!", - " return true;", - "}", + "var Person = function(firstAndLast) {", + " return firstAndLast;", + "};", "", - "", - "", - "telephoneCheck(\"555-555-5555\");" + "var bob = new Person('Bob Ross');", + "bob.getFullName();" + ], + "tests": [ + "expect(Object.keys(bob).length).to.eql(6);", + "expect(bob instanceof Person).to.be.true;", + "expect(bob.firstName).to.be.undefined();", + "expect(bob.lastName).to.be.undefined();", + "expect(bob.getFirstName()).to.eql('Bob');", + "expect(bob.getLastName()).to.eql('Ross');", + "expect(bob.getFullName()).to.eql('Bob Ross');", + "bob.setFirstName('Happy');", + "expect(bob.getFirstName()).to.eql('Happy');", + "bob.setLastName('Trees');", + "expect(bob.getLastName()).to.eql('Trees');", + "bob.setFullName('George Carlin');", + "expect(bob.getFullName()).to.eql('George Carlin');", + "bob.setFullName('Bob Ross');" ], "MDNlinks": [ - "RegExp" + "Closures", + "Details of the Object Model" ], "challengeType": 5, "nameCn": "", @@ -64,31 +55,33 @@ "descriptionPt": [] }, { - "id": "a3f503de51cf954ede28891d", - "name": "Bonfire: Symmetric Difference", - "dashedName": "bonfire-symmetric-difference", - "difficulty": "4.02", + "id": "af4afb223120f7348cdfc9fd", + "name": "Bonfire: Map the Debris", + "dashedName": "bonfire-map-the-debris", + "difficulty": "3.02", "description": [ - "Create a function that takes two or more arrays and returns an array of the symmetric difference of the provided arrays.", - "The mathematical term symmetric difference refers to the elements in two sets that are in either the first or second set, but not in both.", + "Return a new array that transforms the element's average altitude into their orbital periods.", + "The array will contain objects in the format {name: 'name', avgAlt: avgAlt}.", + "You can read about orbital periods on wikipedia.", + "The values should be rounded to the nearest whole number. The body being orbited is Earth.", + "The radius of the earth is 6367.4447 kilometers, and the GM value of earth is 398600.4418", "Remember to use RSAP if you get stuck. Try to pair program. Write your own code." ], "challengeSeed": [ - "function sym(args) {", - " return arguments;", + "function orbitalPeriod(arr) {", + " var GM = 398600.4418;", + " var earthRadius = 6367.4447;", + " return arr;", "}", "", - "sym([1, 2, 3], [5, 2, 1, 4]);" + "orbitalPeriod([{name : \"sputkin\", avgAlt : 35873.5553}]);" ], "tests": [ - "expect(sym([1, 2, 3], [5, 2, 1, 4])).to.equal([3, 5, 4]);", - "assert.deepEqual(sym([1, 2, 5], [2, 3, 5], [3, 4, 5]), [1, 4, 5], 'should return the symmetric difference of the given arrays');", - "assert.deepEqual(sym([1, 1, 2, 5], [2, 2, 3, 5], [3, 4, 5, 5]), [1, 4, 5], 'should return an array of unique values');", - "assert.deepEqual(sym([1, 1]), [1], 'should return an array of unique values');" + "expect(orbitalPeriod([{name : \"sputkin\", avgAlt : 35873.5553}])).to.eqls([{name: \"sputkin\", orbitalPeriod: 86400}]);", + "expect(orbitalPeriod([{name: \"iss\", avgAlt: 413.6}, {name: \"hubble\", avgAlt: 556.7}, {name: \"moon\", avgAlt: 378632.553}])).to.eqls([{name : \"iss\", orbitalPeriod: 5557}, {name: \"hubble\", orbitalPeriod: 5734}, {name: \"moon\", orbitalPeriod: 2377399}]);" ], "MDNlinks": [ - "Array.reduce()", - "Symmetric Difference" + "Math.pow()" ], "challengeType": 5, "nameCn": "", @@ -103,190 +96,32 @@ "descriptionPt": [] }, { - "id": "aa2e6f85cab2ab736c9a9b24", - "name": "Bonfire: Exact Change", - "dashedName": "bonfire-exact-change", - "difficulty": "4.03", + "id": "a3f503de51cfab748ff001aa", + "name": "Bonfire: Pairwise", + "dashedName": "bonfire-pairwise", + "difficulty": "3.03", "description": [ - "Design a cash register drawer function that accepts purchase price as the first argument, payment as the second argument, and cash-in-drawer (cid) as the third argument.", - "cid is a 2d array listing available currency.", - "Return the string \"Insufficient Funds\" if cash-in-drawer is less than the change due. Return the string \"Closed\" if cash-in-drawer is equal to the change due.", - "Otherwise, return change in coin and bills, sorted in highest to lowest order.", + "Return the sum of all indices of elements of 'arr' that can be paired with one other element to form a sum that equals the value in the second argument 'arg'. If multiple sums are possible, return the smallest sum. Once an element has been used, it cannot be reused to pair with another.", + "For example, pairwise([1, 4, 2, 3, 0, 5], 7) should return 11 because 4, 2, 3 and 5 can be paired with each other to equal 7.", + "pairwise([1, 3, 2, 4], 4) would only equal 1, because only the first two elements can be paired to equal 4, and the first element has an index of 0!", "Remember to use RSAP if you get stuck. Try to pair program. Write your own code." ], "challengeSeed": [ - "function drawer(price, cash, cid) {", - " var change;", - " // Here is your change, ma'am.", - " return change;", + "function pairwise(arr, arg) {", + " return arg;", "}", "", - "// Example cash-in-drawer array:", - "// [['PENNY', 1.01],", - "// ['NICKEL', 2.05],", - "// ['DIME', 3.10],", - "// ['QUARTER', 4.25],", - "// ['ONE', 90.00],", - "// ['FIVE', 55.00],", - "// ['TEN', 20.00],", - "// ['TWENTY', 60.00],", - "// ['ONE HUNDRED', 100.00]]", - "", - "drawer(19.50, 20.00, [['PENNY', 1.01], ['NICKEL', 2.05], ['DIME', 3.10], ['QUARTER', 4.25], ['ONE', 90.00], ['FIVE', 55.00], ['TEN', 20.00], ['TWENTY', 60.00], ['ONE HUNDRED', 100.00]]);" + "pairwise([1,4,2,3,0,5], 7);" ], "tests": [ - "expect(drawer(19.50, 20.00, [['PENNY', 1.01], ['NICKEL', 2.05], ['DIME', 3.10], ['QUARTER', 4.25], ['ONE', 90.00], ['FIVE', 55.00], ['TEN', 20.00], ['TWENTY', 60.00], ['ONE HUNDRED', 100.00]])).to.be.a('array');", - "expect(drawer(19.50, 20.00, [['PENNY', 0.01], ['NICKEL', 0], ['DIME', 0], ['QUARTER', 0], ['ONE', 0], ['FIVE', 0], ['TEN', 0], ['TWENTY', 0], ['ONE HUNDRED', 0]])).to.be.a('string');", - "expect(drawer(19.50, 20.00, [['PENNY', 0.50], ['NICKEL', 0], ['DIME', 0], ['QUARTER', 0], ['ONE', 0], ['FIVE', 0], ['TEN', 0], ['TWENTY', 0], ['ONE HUNDRED', 0]])).to.be.a('string');", - "assert.deepEqual(drawer(19.50, 20.00, [['PENNY', 1.01], ['NICKEL', 2.05], ['DIME', 3.10], ['QUARTER', 4.25], ['ONE', 90.00], ['FIVE', 55.00], ['TEN', 20.00], ['TWENTY', 60.00], ['ONE HUNDRED', 100.00]]), [['QUARTER', 0.50]], 'return correct change');", - "assert.deepEqual(drawer(3.26, 100.00, [['PENNY', 1.01], ['NICKEL', 2.05], ['DIME', 3.10], ['QUARTER', 4.25], ['ONE', 90.00], ['FIVE', 55.00], ['TEN', 20.00], ['TWENTY', 60.00], ['ONE HUNDRED', 100.00]]), [['TWENTY', 60.00], ['TEN', 20.00], ['FIVE', 15], ['ONE', 1], ['QUARTER', 0.50], ['DIME', 0.20], ['PENNY', 0.04] ], 'return correct change with multiple coins and bills');", - "assert.deepEqual(drawer(19.50, 20.00, [['PENNY', 0.01], ['NICKEL', 0], ['DIME', 0], ['QUARTER', 0], ['ONE', 0], ['FIVE', 0], ['TEN', 0], ['TWENTY', 0], ['ONE HUNDRED', 0]]), 'Insufficient Funds', 'insufficient funds');", - "assert.deepEqual(drawer(19.50, 20.00, [['PENNY', 0.50], ['NICKEL', 0], ['DIME', 0], ['QUARTER', 0], ['ONE', 0], ['FIVE', 0], ['TEN', 0], ['TWENTY', 0], ['ONE HUNDRED', 0]]), \"Closed\", 'cash-in-drawer equals change');" + "expect(pairwise([1, 4, 2, 3, 0, 5], 7)).to.equal(11);", + "expect(pairwise([1, 3, 2, 4], 4)).to.equal(1);", + "expect(pairwise([1,1,1], 2)).to.equal(1);", + "expect(pairwise([0, 0, 0, 0, 1, 1], 1)).to.equal(10);", + "expect(pairwise([], 100)).to.equal(0);" ], "MDNlinks": [ - "Global Object" - ], - "challengeType": 5, - "nameCn": "", - "descriptionCn": [], - "nameFr": "", - "descriptionFr": [], - "nameRu": "", - "descriptionRu": [], - "nameEs": "", - "descriptionEs": [], - "namePt": "", - "descriptionPt": [] - }, - { - "id": "a56138aff60341a09ed6c480", - "name": "Bonfire: Inventory Update", - "dashedName": "bonfire-inventory-update", - "difficulty": "4.04", - "description": [ - "Compare and update inventory stored in a 2d array against a second 2d array of a fresh delivery. Update current inventory item quantity, and if an item cannot be found, add the new item and quantity into the inventory array in alphabetical order.", - "Remember to use RSAP if you get stuck. Try to pair program. Write your own code." - ], - "challengeSeed": [ - "function inventory(arr1, arr2) {", - " // All inventory must be accounted for or you're fired!", - " return arr1;", - "}", - "", - "// Example inventory lists", - "var curInv = [", - " [21, 'Bowling Ball'],", - " [2, 'Dirty Sock'],", - " [1, 'Hair Pin'],", - " [5, 'Microphone']", - "];", - "", - "var newInv = [", - " [2, 'Hair Pin'],", - " [3, 'Half-Eaten Apple'],", - " [67, 'Bowling Ball'],", - " [7, 'Toothpaste']", - "];", - "", - "inventory(curInv, newInv);" - ], - "tests": [ - "expect(inventory([[21, 'Bowling Ball'], [2, 'Dirty Sock'], [1, 'Hair Pin'], [5, 'Microphone']], [[2, 'Hair Pin'], [3, 'Half-Eaten Apple'], [67, 'Bowling Ball'], [7, 'Toothpaste']])).to.be.a('array');", - "assert.equal(inventory([[21, 'Bowling Ball'], [2, 'Dirty Sock'], [1, 'Hair Pin'], [5, 'Microphone']], [[2, 'Hair Pin'], [3, 'Half-Eaten Apple'], [67, 'Bowling Ball'], [7, 'Toothpaste']]).length, 6);", - "assert.deepEqual(inventory([[21, 'Bowling Ball'], [2, 'Dirty Sock'], [1, 'Hair Pin'], [5, 'Microphone']], [[2, 'Hair Pin'], [3, 'Half-Eaten Apple'], [67, 'Bowling Ball'], [7, 'Toothpaste']]), [[88, 'Bowling Ball'], [2, 'Dirty Sock'], [3, 'Hair Pin'], [3, 'Half-Eaten Apple'], [5, 'Microphone'], [7, 'Toothpaste']]);", - "assert.deepEqual(inventory([[21, 'Bowling Ball'], [2, 'Dirty Sock'], [1, 'Hair Pin'], [5, 'Microphone']], []), [[21, 'Bowling Ball'], [2, 'Dirty Sock'], [1, 'Hair Pin'], [5, 'Microphone']]);", - "assert.deepEqual(inventory([], [[2, 'Hair Pin'], [3, 'Half-Eaten Apple'], [67, 'Bowling Ball'], [7, 'Toothpaste']]), [[67, 'Bowling Ball'], [2, 'Hair Pin'], [3, 'Half-Eaten Apple'], [7, 'Toothpaste']]);", - "assert.deepEqual(inventory([[0, 'Bowling Ball'], [0, 'Dirty Sock'], [0, 'Hair Pin'], [0, 'Microphone']], [[1, 'Hair Pin'], [1, 'Half-Eaten Apple'], [1, 'Bowling Ball'], [1, 'Toothpaste']]), [[1, 'Bowling Ball'], [0, 'Dirty Sock'], [1, 'Hair Pin'], [1, 'Half-Eaten Apple'], [0, 'Microphone'], [1, 'Toothpaste']]);" - ], - "MDNlinks": [ - "Global Array Object" - ], - "challengeType": 5, - "nameCn": "", - "descriptionCn": [], - "nameFr": "", - "descriptionFr": [], - "nameRu": "", - "descriptionRu": [], - "nameEs": "", - "descriptionEs": [], - "namePt": "", - "descriptionPt": [] - }, - { - "id": "a7bf700cd123b9a54eef01d5", - "name": "Bonfire: No repeats please", - "dashedName": "bonfire-no-repeats-please", - "difficulty": "4.05", - "description": [ - "Return the number of total permutations of the provided string that don't have repeated consecutive letters.", - "For example, 'aab' should return 2 because it has 6 total permutations, but only 2 of them don't have the same letter (in this case 'a') repeating.", - "Remember to use RSAP if you get stuck. Try to pair program. Write your own code." - ], - "challengeSeed": [ - "function permAlone(str) {", - " return str;", - "}", - "", - "permAlone('aab');" - ], - "tests": [ - "expect(permAlone('aab')).to.be.a('number');", - "expect(permAlone('aab')).to.equal(2);", - "expect(permAlone('aaa')).to.equal(0);", - "expect(permAlone('aabb')).to.equal(8);", - "expect(permAlone('abcdefa')).to.equal(3600);", - "expect(permAlone('abfdefa')).to.equal(2640);", - "expect(permAlone('zzzzzzzz')).to.equal(0);" - ], - "MDNlinks": [ - "Permutations", - "RegExp" - ], - "challengeType": 5, - "nameCn": "", - "descriptionCn": [], - "nameFr": "", - "descriptionFr": [], - "nameRu": "", - "descriptionRu": [], - "nameEs": "", - "descriptionEs": [], - "namePt": "", - "descriptionPt": [] - }, - { - "id": "a19f0fbe1872186acd434d5a", - "name": "Bonfire: Friendly Date Ranges", - "dashedName": "bonfire-friendly-date-ranges", - "difficulty": "4.06", - "description": [ - "Implement a way of converting two dates into a more friendly date range that could be presented to a user.", - "It must not show any redundant information in the date range.", - "For example, if the year and month are the same then only the day range should be displayed.", - "Secondly, if the starting year is the current year, and the ending year can be inferred by the reader, the year should be omitted.", - "Input date is formatted as YYYY-MM-DD", - "Remember to use RSAP if you get stuck. Try to pair program. Write your own code." - ], - "challengeSeed": [ - "function friendly(str) {", - " return str;", - "}", - "", - "friendly(['2015-07-01', '2015-07-04']);" - ], - "tests": [ - "assert.deepEqual(friendly(['2015-07-01', '2015-07-04']), ['July 1st','4th'], 'ending month should be omitted since it is already mentioned');", - "assert.deepEqual(friendly(['2015-12-01', '2016-02-03']), ['December 1st','February 3rd'], 'two months apart can be inferred if it is the next year');", - "assert.deepEqual(friendly(['2015-12-01', '2017-02-03']), ['December 1st, 2015','February 3rd, 2017']);", - "assert.deepEqual(friendly(['2016-03-01', '2016-05-05']), ['March 1st','May 5th'], 'one month apart can be inferred it is the same year');", - "assert.deepEqual(friendly(['2017-01-01', '2017-01-01']), ['January 1st, 2017'], 'since we do not duplicate only return once');", - "assert.deepEqual(friendly(['2022-09-05', '2023-09-04']), ['September 5th, 2022','September 4th, 2023']);" - ], - "MDNlinks": [ - "String.split()", - "String.substr()", - "parseInt()" + "Array.reduce()" ], "challengeType": 5, "nameCn": "", diff --git a/seed/challenges/angularjs.json b/seed/challenges/angularjs.json index 48207fb41f..0e1b5acc32 100644 --- a/seed/challenges/angularjs.json +++ b/seed/challenges/angularjs.json @@ -1,6 +1,6 @@ { "name": "AngularJS", - "order": 0.015, + "order": 0.016, "challenges": [ { "id": "bd7154d8c441eddfaeb5bdef", diff --git a/seed/challenges/automated-testing-and-debugging.json b/seed/challenges/automated-testing-and-debugging.json new file mode 100644 index 0000000000..b19438acec --- /dev/null +++ b/seed/challenges/automated-testing-and-debugging.json @@ -0,0 +1,6 @@ +{ + "name": "Automated Testing and Debugging - Coming Soon", + "order": 0.011, + "challenges": [ + ] +} diff --git a/seed/challenges/basejumps.json b/seed/challenges/basejumps.json index 717a99a47d..44d406797c 100644 --- a/seed/challenges/basejumps.json +++ b/seed/challenges/basejumps.json @@ -1,6 +1,6 @@ { "name": "Full Stack JavaScript Projects", - "order": 0.017, + "order": 0.018, "challenges": [ { "id": "bd7158d8c443eddfaeb5bcef", diff --git a/seed/challenges/basic-bonfires.json b/seed/challenges/basic-bonfires.json index 8d97403e21..c2f19318e1 100644 --- a/seed/challenges/basic-bonfires.json +++ b/seed/challenges/basic-bonfires.json @@ -1,13 +1,15 @@ { "name": "Basic Algorithm Scripting", - "order": 0.007, + "order": 0.006, "challenges": [ { "id": "bd7139d8c441eddfaeb5bdef", "name": "Waypoint: Pair Program on Bonfires", "dashedName": "waypoint-pair-program-on-bonfires", "difficulty": 0.44, - "challengeSeed": ["119657641"], + "challengeSeed": [ + "119657641" + ], "description": [ "Please note that the video for this challenge is a little outdated, and doesn't perfectly match these steps. We plan to record a new video soon.", "OK, we're finally ready to start pair programming!", @@ -715,815 +717,6 @@ "descriptionEs": [], "namePt": "", "descriptionPt": [] - }, - { - "id": "a3566b1109230028080c9345", - "name": "Bonfire: Sum All Numbers in a Range", - "dashedName": "bonfire-sum-all-numbers-in-a-range", - "difficulty": "2.00", - "description": [ - "We'll pass you an array of two numbers. Return the sum of those two numbers and all numbers between them.", - "The lowest number will not always come first.", - "Remember to use RSAP if you get stuck. Try to pair program. Write your own code." - ], - "challengeSeed": [ - "function sumAll(arr) {", - " return(1);", - "}", - "", - "sumAll([1, 4]);" - ], - "tests": [ - "expect(sumAll([1, 4])).to.be.a('Number');", - "expect(sumAll([1, 4])).to.equal(10);", - "expect(sumAll([4, 1])).to.equal(10);", - "expect(sumAll([5, 10])).to.equal(45);", - "expect(sumAll([10, 5])).to.equal(45);" - ], - "MDNlinks": [ - "Math.max()", - "Math.min()", - "Array.reduce()" - ], - "challengeType": 5, - "nameCn": "", - "descriptionCn": [], - "nameFr": "", - "descriptionFr": [], - "nameRu": "", - "descriptionRu": [], - "nameEs": "", - "descriptionEs": [], - "namePt": "", - "descriptionPt": [] - }, - { - "id": "a5de63ebea8dbee56860f4f2", - "name": "Bonfire: Diff Two Arrays", - "dashedName": "bonfire-diff-two-arrays", - "difficulty": "2.01", - "description": [ - "Compare two arrays and return a new array with any items not found in both of the original arrays.", - "Remember to use RSAP if you get stuck. Try to pair program. Write your own code." - ], - "challengeSeed": [ - "function diff(arr1, arr2) {", - " var newArr = [];", - " // Same, same; but different.", - " return newArr;", - "}", - "", - "diff([1, 2, 3, 5], [1, 2, 3, 4, 5]);" - ], - "tests": [ - "expect(diff([1, 2, 3, 5], [1, 2, 3, 4, 5])).to.be.a('array');", - "assert.deepEqual(diff(['diorite', 'andesite', 'grass', 'dirt', 'pink wool', 'dead shrub'], ['diorite', 'andesite', 'grass', 'dirt', 'dead shrub']), ['pink wool'], 'arrays with only one difference');", - "assert.includeMembers(diff(['andesite', 'grass', 'dirt', 'pink wool', 'dead shrub'], ['diorite', 'andesite', 'grass', 'dirt', 'dead shrub']), ['diorite', 'pink wool'], 'arrays with more than one difference');", - "assert.deepEqual(diff(['andesite', 'grass', 'dirt', 'dead shrub'], ['andesite', 'grass', 'dirt', 'dead shrub']), [], 'arrays with no difference');", - "assert.deepEqual(diff([1, 2, 3, 5], [1, 2, 3, 4, 5]), [4], 'arrays with numbers');", - "assert.includeMembers(diff([1, 'calf', 3, 'piglet'], [1, 'calf', 3, 4]), ['piglet', 4], 'arrays with numbers and strings');", - "assert.deepEqual(diff([], ['snuffleupagus', 'cookie monster', 'elmo']), ['snuffleupagus', 'cookie monster', 'elmo'], 'empty array');" - ], - "MDNlinks": [ - "Comparison Operators", - "String.slice()", - "Array.filter()", - "Array.indexOf()", - "String.concat()" - ], - "challengeType": 5, - "nameCn": "", - "descriptionCn": [], - "nameFr": "", - "descriptionFr": [], - "nameRu": "", - "descriptionRu": [], - "nameEs": "", - "descriptionEs": [], - "namePt": "", - "descriptionPt": [] - }, - { - "id": "a7f4d8f2483413a6ce226cac", - "name": "Bonfire: Roman Numeral Converter", - "dashedName": "bonfire-roman-numeral-converter", - "tests": [ - "expect(convert(12)).to.equal(\"XII\");", - "expect(convert(5)).to.equal(\"V\");", - "expect(convert(9)).to.equal(\"IX\");", - "expect(convert(29)).to.equal(\"XXIX\");", - "expect(convert(16)).to.equal(\"XVI\");" - ], - "difficulty": "2.02", - "description": [ - "Convert the given number into a roman numeral.", - "All roman numerals answers should be provided in upper-case.", - "Remember to use RSAP if you get stuck. Try to pair program. Write your own code." - ], - "challengeSeed": [ - "function convert(num) {", - " return num;", - "}", - "", - "convert(36);" - ], - "MDNlinks": [ - "Array.splice()", - "Array.indexOf()", - "Array.join()" - ], - "challengeType": 5, - "nameCn": "", - "descriptionCn": [], - "nameFr": "", - "descriptionFr": [], - "nameRu": "", - "descriptionRu": [], - "nameEs": "", - "descriptionEs": [], - "namePt": "", - "descriptionPt": [] - }, - { - "id": "a0b5010f579e69b815e7c5d6", - "name": "Bonfire: Search and Replace", - "dashedName": "bonfire-search-and-replace", - "tests": [ - "expect(replace(\"Let us go to the store\", \"store\", \"mall\")).to.equal(\"Let us go to the mall\");", - "expect(replace(\"He is Sleeping on the couch\", \"Sleeping\", \"sitting\")).to.equal(\"He is Sitting on the couch\");", - "expect(replace(\"This has a spellngi error\", \"spellngi\", \"spelling\")).to.equal(\"This has a spelling error\");", - "expect(replace(\"His name is Tom\", \"Tom\", \"john\")).to.equal(\"His name is John\");", - "expect(replace(\"Let us get back to more Coding\", \"Coding\", \"bonfires\")).to.equal(\"Let us get back to more Bonfires\");" - ], - "difficulty": "2.03", - "description": [ - "Perform a search and replace on the sentence using the arguments provided and return the new sentence.", - "First argument is the sentence to perform the search and replace on.", - "Second argument is the word that you will be replacing (before).", - "Third argument is what you will be replacing the second argument with (after).", - "NOTE: Preserve the case of the original word when you are replacing it. For example if you mean to replace the word 'Book' with the word 'dog', it should be replaced as 'Dog'", - "Remember to use RSAP if you get stuck. Try to pair program. Write your own code." - ], - "challengeSeed": [ - "function replace(str, before, after) {", - " return str;", - "}", - "", - "replace(\"A quick brown fox jumped over the lazy dog\", \"jumped\", \"leaped\");" - ], - "MDNlinks": [ - "Array.splice()", - "String.replace()", - "Array.join()" - ], - "challengeType": 5, - "nameCn": "", - "descriptionCn": [], - "nameFr": "", - "descriptionFr": [], - "nameRu": "", - "descriptionRu": [], - "nameEs": "", - "descriptionEs": [], - "namePt": "", - "descriptionPt": [] - }, - { - "id": "aa7697ea2477d1316795783b", - "name": "Bonfire: Pig Latin", - "dashedName": "bonfire-pig-latin", - "tests": [ - "expect(translate(\"california\")).to.equal(\"aliforniacay\");", - "expect(translate(\"paragraphs\")).to.equal(\"aragraphspay\");", - "expect(translate(\"glove\")).to.equal(\"oveglay\");", - "expect(translate(\"algorithm\")).to.equal(\"algorithmway\");", - "expect(translate(\"eight\")).to.equal(\"eightway\");" - ], - "difficulty": "2.04", - "description": [ - "Translate the provided string to pig latin.", - "Pig Latin takes the first consonant (or consonant cluster) of an English word, moves it to the end of the word and suffixes an \"ay\".", - "If a word begins with a vowel you just add \"way\" to the end.", - "Remember to use RSAP if you get stuck. Try to pair program. Write your own code." - ], - "challengeSeed": [ - "function translate(str) {", - " return str;", - "}", - "", - "translate(\"consonant\");" - ], - "MDNlinks": [ - "Array.indexOf()", - "Array.push()", - "Array.join()", - "String.substr()", - "String.split()" - ], - "challengeType": 5, - "nameCn": "", - "descriptionCn": [], - "nameFr": "", - "descriptionFr": [], - "nameRu": "", - "descriptionRu": [], - "nameEs": "", - "descriptionEs": [], - "namePt": "", - "descriptionPt": [] - }, - { - "id": "afd15382cdfb22c9efe8b7de", - "name": "Bonfire: DNA Pairing", - "dashedName": "bonfire-dna-pairing", - "tests": [ - "assert.deepEqual(pair(\"ATCGA\"),[['A','T'],['T','A'],['C','G'],['G','C'],['A','T']], 'should return the dna pair');", - "assert.deepEqual(pair(\"TTGAG\"),[['T','A'],['T','A'],['G','C'],['A','T'],['G','C']], 'should return the dna pair');", - "assert.deepEqual(pair(\"CTCTA\"),[['C','G'],['T','A'],['C','G'],['T','A'],['A','T']], 'should return the dna pair');" - ], - "difficulty": "2.05", - "description": [ - "The DNA strand is missing the pairing element. Match each character with the missing element and return the results as a 2d array.", - "Base pairs are a pair of AT and CG. Match the missing element to the provided character.", - "Return the provided character as the first element in each array.", - "Remember to use RSAP if you get stuck. Try to pair program. Write your own code." - ], - "challengeSeed": [ - "function pair(str) {", - " return str;", - "}", - "", - "pair(\"GCG\");" - ], - "MDNlinks": [ - "Array.push()", - "String.split()" - ], - "challengeType": 5, - "nameCn": "", - "descriptionCn": [], - "nameFr": "", - "descriptionFr": [], - "nameRu": "", - "descriptionRu": [], - "nameEs": "", - "descriptionEs": [], - "namePt": "", - "descriptionPt": [] - }, - { - "id": "af7588ade1100bde429baf20", - "name": "Bonfire: Missing letters", - "dashedName": "bonfire-missing-letters", - "difficulty": "2.05", - "description": [ - "Find the missing letter in the passed letter range and return it.", - "If all letters are present in the range, return undefined.", - "Remember to use RSAP if you get stuck. Try to pair program. Write your own code." - ], - "challengeSeed": [ - "function fearNotLetter(str) {", - " return str;", - "}", - "", - "fearNotLetter('abce');" - ], - "tests": [ - "expect(fearNotLetter('abce')).to.equal('d');", - "expect(fearNotLetter('bcd')).to.be.undefined;", - "expect(fearNotLetter('abcdefghjklmno')).to.equal('i');", - "expect(fearNotLetter('yz')).to.be.undefined;" - ], - "MDNlinks": [ - "String.charCodeAt()", - "String.fromCharCode()" - ], - "challengeType": 5, - "nameCn": "", - "descriptionCn": [], - "nameFr": "", - "descriptionFr": [], - "nameRu": "", - "descriptionRu": [], - "nameEs": "", - "descriptionEs": [], - "namePt": "", - "descriptionPt": [] - }, - { - "id": "a77dbc43c33f39daa4429b4f", - "name": "Bonfire: Boo who", - "dashedName": "bonfire-boo-who", - "difficulty": "2.06", - "description": [ - "Check if a value is classified as a boolean primitive. Return true or false.", - "Boolean primitives are true and false.", - "Remember to use RSAP if you get stuck. Try to pair program. Write your own code." - ], - "challengeSeed": [ - "function boo(bool) {", - " // What is the new fad diet for ghost developers? The Boolean.", - " return bool;", - "}", - "", - "boo(null);" - ], - "tests": [ - "assert.strictEqual(boo(true), true);", - "assert.strictEqual(boo(false), true);", - "assert.strictEqual(boo([1, 2, 3]), false);", - "assert.strictEqual(boo([].slice), false);", - "assert.strictEqual(boo({ 'a': 1 }), false);", - "assert.strictEqual(boo(1), false);", - "assert.strictEqual(boo(NaN), false);", - "assert.strictEqual(boo('a'), false);" - ], - "MDNlinks": [ - "Boolean Objects" - ], - "challengeType": 5, - "nameCn": "", - "descriptionCn": [], - "nameFr": "", - "descriptionFr": [], - "nameRu": "", - "descriptionRu": [], - "nameEs": "", - "descriptionEs": [], - "namePt": "", - "descriptionPt": [] - }, - { - "id": "a105e963526e7de52b219be9", - "name": "Bonfire: Sorted Union", - "dashedName": "bonfire-sorted-union", - "difficulty": "2.07", - "description": [ - "Write a function that takes two or more arrays and returns a new array of unique values in the order of the original provided arrays.", - "In other words, all values present from all arrays should be included in their original order, but with no duplicates in the final array.", - "The unique numbers should be sorted by their original order, but the final array should not be sorted in numerical order.", - "Check the assertion tests for examples.", - "Remember to use RSAP if you get stuck. Try to pair program. Write your own code." - ], - "challengeSeed": [ - "function unite(arr1, arr2, arr3) {", - " return arr1;", - "}", - "", - "unite([1, 2, 3], [5, 2, 1, 4], [2, 1]);" - ], - "tests": [ - "assert.deepEqual(unite([1, 3, 2], [5, 2, 1, 4], [2, 1]), [1, 3, 2, 5, 4], 'should return the union of the given arrays');", - "assert.deepEqual(unite([1, 3, 2], [1, [5]], [2, [4]]), [1, 3, 2, [5], [4]], 'should not flatten nested arrays');", - "assert.deepEqual(unite([1, 2, 3], [5, 2, 1]), [1, 2, 3, 5], 'should correctly handle exactly two arguments');", - "assert.deepEqual(unite([1, 2, 3], [5, 2, 1, 4], [2, 1], [6, 7, 8]), [ 1, 2, 3, 5, 4, 6, 7, 8 ], 'should correctly handle higher numbers of arguments');" - ], - "MDNlinks": [ - "Arguments object", - "Array.reduce()" - ], - "challengeType": 5, - "nameCn": "", - "descriptionCn": [], - "nameFr": "", - "descriptionFr": [], - "nameRu": "", - "descriptionRu": [], - "nameEs": "", - "descriptionEs": [], - "namePt": "", - "descriptionPt": [] - }, - { - "id": "a6b0bb188d873cb2c8729495", - "name": "Bonfire: Convert HTML Entities", - "dashedName": "bonfire-convert-html-entities", - "difficulty": "2.07", - "description": [ - "Convert the characters \"&\", \"<\", \">\", '\"' (double quote), and \"'\" (apostrophe), in a string to their corresponding HTML entities.", - "Remember to use RSAP if you get stuck. Try to pair program. Write your own code." - ], - "challengeSeed": [ - "function convert(str) {", - " // :)", - " return str;", - "}", - "", - "convert('Dolce & Gabbana');" - ], - "tests": [ - "assert.strictEqual(convert('Dolce & Gabbana'), 'Dolce & Gabbana', 'should escape characters');", - "assert.strictEqual(convert('Hamburgers < Pizza < Tacos'), 'Hamburgers < Pizza < Tacos', 'should escape characters');", - "assert.strictEqual(convert('Sixty > twelve'), 'Sixty > twelve', 'should escape characters');", - "assert.strictEqual(convert('Stuff in \"quotation marks\"'), 'Stuff in "quotation marks"', 'should escape characters');", - "assert.strictEqual(convert(\"Shindler's List\"), 'Shindler's List', 'should escape characters');", - "assert.strictEqual(convert('<>'), '<>', 'should escape characters');", - "assert.strictEqual(convert('abc'), 'abc', 'should handle strings with nothing to escape');" - ], - "MDNlinks": [ - "RegExp", - "HTML Entities" - ], - "challengeType": 5, - "nameCn": "", - "descriptionCn": [], - "nameFr": "", - "descriptionFr": [], - "nameRu": "", - "descriptionRu": [], - "nameEs": "", - "descriptionEs": [], - "namePt": "", - "descriptionPt": [] - }, - { - "id": "a103376db3ba46b2d50db289", - "name": "Bonfire: Spinal Tap Case", - "dashedName": "bonfire-spinal-tap-case", - "difficulty": "2.08", - "description": [ - "Convert a string to spinal case. Spinal case is all-lowercase-words-joined-by-dashes.", - "Remember to use RSAP if you get stuck. Try to pair program. Write your own code." - ], - "challengeSeed": [ - "function spinalCase(str) {", - " // \"It's such a fine line between stupid, and clever.\"", - " // --David St. Hubbins", - " return str;", - "}", - "", - "spinalCase('This Is Spinal Tap');" - ], - "tests": [ - "assert.strictEqual(spinalCase('This Is Spinal Tap'), 'this-is-spinal-tap', 'should return spinal case from string with spaces');", - "assert.strictEqual(spinalCase('thisIsSpinalTap'), 'this-is-spinal-tap', 'should return spinal case from string with camel case');", - "assert.strictEqual(spinalCase('The_Andy_Griffith_Show'), 'the-andy-griffith-show', 'should return spinal case from string with snake case');", - "assert.strictEqual(spinalCase('Teletubbies say Eh-oh'), 'teletubbies-say-eh-oh', 'should return spinal case from string with spaces and hyphens');" - ], - "MDNlinks": [ - "RegExp", - "String.replace()" - ], - "challengeType": 5, - "nameCn": "", - "descriptionCn": [], - "nameFr": "", - "descriptionFr": [], - "nameRu": "", - "descriptionRu": [], - "nameEs": "", - "descriptionEs": [], - "namePt": "", - "descriptionPt": [] - }, - { - "id": "a5229172f011153519423690", - "name": "Bonfire: Sum All Odd Fibonacci Numbers", - "dashedName": "bonfire-sum-all-odd-fibonacci-numbers", - "difficulty": "2.09", - "description": [ - "Return the sum of all odd Fibonacci numbers up to and including the passed number if it is a Fibonacci number.", - "The first few numbers of the Fibonacci sequence are 1, 1, 2, 3, 5 and 8, and each subsequent number is the sum of the previous two numbers.", - "As an example, passing 4 to the function should return 5 because all the odd Fibonacci numbers under 4 are 1, 1, and 3.", - "Remember to use RSAP if you get stuck. Try to pair program. Write your own code." - ], - "challengeSeed": [ - "function sumFibs(num) {", - " return num;", - "}", - "", - "sumFibs(4);" - ], - "tests": [ - "expect(sumFibs(1)).to.be.a('number');", - "expect(sumFibs(1000)).to.equal(1785);", - "expect(sumFibs(4000000)).to.equal(4613732);", - "expect(sumFibs(4)).to.equal(5);", - "expect(sumFibs(75024)).to.equal(60696);", - "expect(sumFibs(75025)).to.equal(135721);" - ], - "MDNlinks": [ - "Remainder" - ], - "challengeType": 5, - "nameCn": "", - "descriptionCn": [], - "nameFr": "", - "descriptionFr": [], - "nameRu": "", - "descriptionRu": [], - "nameEs": "", - "descriptionEs": [], - "namePt": "", - "descriptionPt": [] - }, - { - "id": "a3bfc1673c0526e06d3ac698", - "name": "Bonfire: Sum All Primes", - "dashedName": "bonfire-sum-all-primes", - "difficulty": "2.10", - "description": [ - "Sum all the prime numbers up to and including the provided number.", - "A prime number is defined as having only two divisors, 1 and itself. For example, 2 is a prime number because it's only divisible by 1 and 2. 1 isn't a prime number, because it's only divisible by itself.", - "The provided number may not be a prime.", - "Remember to use RSAP if you get stuck. Try to pair program. Write your own code." - ], - "challengeSeed": [ - "function sumPrimes(num) {", - " return num;", - "}", - "", - "sumPrimes(10);" - ], - "tests": [ - "expect(sumPrimes(10)).to.be.a('number');", - "expect(sumPrimes(10)).to.equal(17);", - "expect(sumPrimes(977)).to.equal(73156);" - ], - "MDNlinks": [ - "For Loops", - "Array.push()" - ], - "challengeType": 5, - "nameCn": "", - "descriptionCn": [], - "nameFr": "", - "descriptionFr": [], - "nameRu": "", - "descriptionRu": [], - "nameEs": "", - "descriptionEs": [], - "namePt": "", - "descriptionPt": [] - }, - { - "id": "ae9defd7acaf69703ab432ea", - "name": "Bonfire: Smallest Common Multiple", - "dashedName": "bonfire-smallest-common-multiple", - "difficulty": "2.11", - "description": [ - "Find the smallest number that is evenly divisible by all numbers in the provided range.", - "The range will be an array of two numbers that will not necessarily be in numerical order.", - "Remember to use RSAP if you get stuck. Try to pair program. Write your own code." - ], - "challengeSeed": [ - "function smallestCommons(arr) {", - " return arr;", - "}", - "", - "", - "smallestCommons([1,5]);" - ], - "tests": [ - "expect(smallestCommons([1,5])).to.be.a('number');", - "expect(smallestCommons([1,5])).to.equal(60);", - "expect(smallestCommons([5,1])).to.equal(60);", - "expect(smallestCommons([1,13])).to.equal(360360);" - ], - "MDNlinks": [ - "Smallest Common Multiple" - ], - "challengeType": 5, - "nameCn": "", - "descriptionCn": [], - "nameFr": "", - "descriptionFr": [], - "nameRu": "", - "descriptionRu": [], - "nameEs": "", - "descriptionEs": [], - "namePt": "", - "descriptionPt": [] - }, - { - "id": "a6e40f1041b06c996f7b2406", - "name": "Bonfire: Finders Keepers", - "dashedName": "bonfire-finders-keepers", - "difficulty": "2.12", - "description": [ - "Create a function that looks through an array (first argument) and returns the first element in the array that passes a truth test (second argument).", - "Remember to use RSAP if you get stuck. Try to pair program. Write your own code." - ], - "challengeSeed": [ - "function find(arr, func) {", - " var num = 0;", - " return num;", - "}", - "", - "find([1, 2, 3, 4], function(num){ return num % 2 === 0; });" - ], - "tests": [ - "assert.strictEqual(find([1, 3, 5, 8, 9, 10], function(num) { return num % 2 === 0; }), 8, 'should return first found value');", - "assert.strictEqual(find([1, 3, 5, 9], function(num) { return num % 2 === 0; }), undefined, 'should return undefined if not found');" - ], - "MDNlinks": [ - "Array.some()" - ], - "challengeType": 5, - "nameCn": "", - "descriptionCn": [], - "nameFr": "", - "descriptionFr": [], - "nameRu": "", - "descriptionRu": [], - "nameEs": "", - "descriptionEs": [], - "namePt": "", - "descriptionPt": [] - }, - { - "id": "a5deed1811a43193f9f1c841", - "name": "Bonfire: Drop it", - "dashedName": "bonfire-drop-it", - "difficulty": "2.13", - "description": [ - "Drop the elements of an array (first argument), starting from the front, until the predicate (second argument) returns true.", - "Remember to use RSAP if you get stuck. Try to pair program. Write your own code." - ], - "challengeSeed": [ - "function drop(arr, func) {", - " // Drop them elements.", - " return arr;", - "}", - "", - "drop([1, 2, 3], function(n) {return n < 3; });" - ], - "tests": [ - "expect(drop([1, 2, 3, 4], function(n) {return n >= 3; })).to.eqls([3, 4]);", - "expect(drop([1, 2, 3], function(n) {return n > 0; })).to.eqls([1, 2, 3]);", - "expect(drop([1, 2, 3, 4], function(n) {return n > 5; })).to.eqls([]);" - ], - "MDNlinks": [ - "Arguments object", - "Array.shift()" - ], - "challengeType": 5, - "nameCn": "", - "descriptionCn": [], - "nameFr": "", - "descriptionFr": [], - "nameRu": "", - "descriptionRu": [], - "nameEs": "", - "descriptionEs": [], - "namePt": "", - "descriptionPt": [] - }, - { - "id": "ab306dbdcc907c7ddfc30830", - "name": "Bonfire: Steamroller", - "dashedName": "bonfire-steamroller", - "difficulty": "2.14", - "description": [ - "Flatten a nested array. You must account for varying levels of nesting.", - "Remember to use RSAP if you get stuck. Try to pair program. Write your own code." - ], - "challengeSeed": [ - "function steamroller(arr) {", - " // I'm a steamroller, baby", - " return arr;", - "}", - "", - "steamroller([1, [2], [3, [[4]]]]);" - ], - "tests": [ - "assert.deepEqual(steamroller([[['a']], [['b']]]), ['a', 'b'], 'should flatten nested arrays');", - "assert.deepEqual(steamroller([1, [2], [3, [[4]]]]), [1, 2, 3, 4], 'should flatten nested arrays');", - "assert.deepEqual(steamroller([1, [], [3, [[4]]]]), [1, 3, 4], 'should work with empty arrays');" - ], - "MDNlinks": [ - "Array.isArray()" - ], - "challengeType": 5, - "nameCn": "", - "descriptionCn": [], - "nameFr": "", - "descriptionFr": [], - "nameRu": "", - "descriptionRu": [], - "nameEs": "", - "descriptionEs": [], - "namePt": "", - "descriptionPt": [] - }, - { - "id": "a8d97bd4c764e91f9d2bda01", - "name": "Bonfire: Binary Agents", - "dashedName": "bonfire-binary-agents", - "difficulty": "2.15", - "description": [ - "Return an English translated sentence of the passed binary string.", - "The binary string will be space separated.", - "Remember to use RSAP if you get stuck. Try to pair program. Write your own code." - ], - "challengeSeed": [ - "function binaryAgent(str) {", - " return str;", - "}", - "", - "binaryAgent('01000001 01110010 01100101 01101110 00100111 01110100 00100000 01100010 01101111 01101110 01100110 01101001 01110010 01100101 01110011 00100000 01100110 01110101 01101110 00100001 00111111');" - ], - "tests": [ - "expect(binaryAgent('01000001 01110010 01100101 01101110 00100111 01110100 00100000 01100010 01101111 01101110 01100110 01101001 01110010 01100101 01110011 00100000 01100110 01110101 01101110 00100001 00111111')).to.equal(\"Aren't bonfires fun!?\");", - "expect(binaryAgent('01001001 00100000 01101100 01101111 01110110 01100101 00100000 01000110 01110010 01100101 01100101 01000011 01101111 01100100 01100101 01000011 01100001 01101101 01110000 00100001')).to.equal(\"I love FreeCodeCamp!\");" - ], - "MDNlinks": [ - "String.charCodeAt()", - "String.fromCharCode()" - ], - "challengeType": 5, - "nameCn": "", - "descriptionCn": [], - "nameFr": "", - "descriptionFr": [], - "nameRu": "", - "descriptionRu": [], - "nameEs": "", - "descriptionEs": [], - "namePt": "", - "descriptionPt": [] - }, - { - "id": "a10d2431ad0c6a099a4b8b52", - "name": "Bonfire: Everything Be True", - "dashedName": "bonfire-everything-be-true", - "difficulty": "2.21", - "description": [ - "Check if the predicate (second argument) returns truthy (defined) for all elements of a collection (first argument).", - "For this, check to see if the property defined in the second argument is present on every element of the collection.", - "Remember, you can access object properties through either dot notation or [] notation.", - "Remember to use RSAP if you get stuck. Try to pair program. Write your own code." - ], - "challengeSeed": [ - "function every(collection, pre) {", - " // Does everyone have one of these?", - " return pre;", - "}", - "", - "every([{'user': 'Tinky-Winky', 'sex': 'male'}, {'user': 'Dipsy', 'sex': 'male'}, {'user': 'Laa-Laa', 'sex': 'female'}, {'user': 'Po', 'sex': 'female'}], 'sex');" - ], - "tests": [ - "assert.strictEqual(every([{'user': 'Tinky-Winky', 'sex': 'male'}, {'user': 'Dipsy', 'sex': 'male'}, {'user': 'Laa-Laa', 'sex': 'female'}, {'user': 'Po', 'sex': 'female'}], 'sex'), true, 'should return true if predicate returns truthy for all elements in the collection');", - "assert.strictEqual(every([{'user': 'Tinky-Winky', 'sex': 'male'}, {'user': 'Dipsy', 'sex': 'male'}, {'user': 'Laa-Laa', 'sex': 'female'}, {'user': 'Po', 'sex': 'female'}], {'sex': 'female'}), false, 'should return false if predicate returns falsey for any element in the collection');", - "assert.strictEqual(every([{'user': 'Tinky-Winky', 'sex': 'female'}, {'user': 'Dipsy', 'sex': 'male'}, {'user': 'Laa-Laa', 'sex': 'female'}, {'user': 'Po', 'sex': 'female'}], {'sex': 'female'}), false, 'should return false if predicate returns falsey for any element in the collection');" - - ], - "MDNlinks": [ - "Object.hasOwnProperty()", - "Object.getOwnPropertyNames()" - ], - "challengeType": 5, - "nameCn": "", - "descriptionCn": [], - "nameFr": "", - "descriptionFr": [], - "nameRu": "", - "descriptionRu": [], - "nameEs": "", - "descriptionEs": [], - "namePt": "", - "descriptionPt": [] - }, - { - "id": "a97fd23d9b809dac9921074f", - "name": "Bonfire: Arguments Optional", - "dashedName": "bonfire-arguments-optional", - "difficulty": "2.22", - "description": [ - "Create a function that sums two arguments together. If only one argument is provided, return a function that expects one additional argument and will return the sum.", - "For example, add(2, 3) should return 5, and add(2) should return a function that is waiting for an argument so that var sum2And = add(2); return sum2And(3); // 5", - "If either argument isn't a valid number, return undefined.", - "Remember to use RSAP if you get stuck. Try to pair program. Write your own code." - ], - "challengeSeed": [ - "function add() {", - " return false;", - "}", - "", - "add(2,3);" - ], - "tests": [ - "expect(add(2, 3)).to.equal(5);", - "expect(add(2)(3)).to.equal(5);", - "expect(add('http://bit.ly/IqT6zt')).to.be.undefined;", - "expect(add(2, '3')).to.be.undefined;", - "expect(add(2)([3])).to.be.undefined;" - ], - "MDNlinks": [ - "Global Function Object", - "Arguments object" - ], - "challengeType": 5, - "nameCn": "", - "descriptionCn": [], - "nameFr": "", - "descriptionFr": [], - "nameRu": "", - "descriptionRu": [], - "nameEs": "", - "descriptionEs": [], - "namePt": "", - "descriptionPt": [] } ] } diff --git a/seed/challenges/basic-javascript.json b/seed/challenges/basic-javascript.json index ab30786d54..42233ed0e6 100644 --- a/seed/challenges/basic-javascript.json +++ b/seed/challenges/basic-javascript.json @@ -1,6 +1,6 @@ { "name": "Basic JavaScript", - "order": 0.006, + "order": 0.005, "challenges": [ { "id":"bd7123c9c441eddfaeb4bdef", diff --git a/seed/challenges/basic-ziplines.json b/seed/challenges/basic-ziplines.json index 23306c1ba1..cb4f9bd8a5 100644 --- a/seed/challenges/basic-ziplines.json +++ b/seed/challenges/basic-ziplines.json @@ -1,6 +1,6 @@ { "name": "Basic Front End Development Projects", - "order": 0.006, + "order": 0.007, "challenges": [ { "id": "bd7158d8c442eddfbeb5bd1f", diff --git a/seed/challenges/expert-bonfires.json b/seed/challenges/expert-bonfires.json new file mode 100644 index 0000000000..2cf00386a5 --- /dev/null +++ b/seed/challenges/expert-bonfires.json @@ -0,0 +1,304 @@ +{ + "name": "Expert Algorithm Scripting", + "order": 0.012, + "challenges": [ + { + "id": "aff0395860f5d3034dc0bfc9", + "name": "Bonfire: Validate US Telephone Numbers", + "dashedName": "bonfire-validate-us-telephone-numbers", + "difficulty": "4.01", + "description": [ + "Return true if the passed string is a valid US phone number", + "The user may fill out the form field any way they choose as long as it is a valid US number. The following are all valid formats for US numbers:", + "555-555-5555, (555)555-5555, (555) 555-5555, 555 555 5555, 5555555555, 1 555 555 5555", + "For this challenge you will be presented with a string such as \"800-692-7753\" or \"8oo-six427676;laskdjf\". Your job is to validate or reject the US phone number based on any combination of the formats provided above. The area code is required. If the country code is provided, you must confirm that the country code is \"1\". Return true if the string is a valid US phone number; otherwise false.", + "Remember to use RSAP if you get stuck. Try to pair program. Write your own code." + ], + "tests": [ + "expect(telephoneCheck(\"555-555-5555\")).to.be.a(\"boolean\");", + "assert.deepEqual(telephoneCheck(\"1 555-555-5555\"), true);", + "assert.deepEqual(telephoneCheck(\"1 (555) 555-5555\"), true);", + "assert.deepEqual(telephoneCheck(\"5555555555\"), true);", + "assert.deepEqual(telephoneCheck(\"555-555-5555\"), true);", + "assert.deepEqual(telephoneCheck(\"(555)555-5555\"), true);", + "assert.deepEqual(telephoneCheck(\"1(555)555-5555\"), true);", + "assert.deepEqual(telephoneCheck(\"1 555 555 5555\"), true);", + "assert.deepEqual(telephoneCheck(\"555-555-5555\"), true);", + "assert.deepEqual(telephoneCheck(\"1 456 789 4444\"), true);", + "assert.deepEqual(telephoneCheck(\"123**&!!asdf#\"), false);", + "assert.deepEqual(telephoneCheck(\"55555555\"), false);", + "assert.deepEqual(telephoneCheck(\"(6505552368)\"), false);", + "assert.deepEqual(telephoneCheck(\"2 (757) 622-7382\"), false);", + "assert.deepEqual(telephoneCheck(\"0 (757) 622-7382\"), false);", + "assert.deepEqual(telephoneCheck(\"-1 (757) 622-7382\"), false);", + "assert.deepEqual(telephoneCheck(\"2 757 622-7382\"), false);", + "assert.deepEqual(telephoneCheck(\"10 (757) 622-7382\"), false);", + "assert.deepEqual(telephoneCheck(\"27576227382\"), false);", + "assert.deepEqual(telephoneCheck(\"(275)76227382\"), false);", + "assert.deepEqual(telephoneCheck(\"2(757)6227382\"), false);", + "assert.deepEqual(telephoneCheck(\"2(757)622-7382\"), false);" + ], + "challengeSeed": [ + "function telephoneCheck(str) {", + " // Good luck!", + " return true;", + "}", + "", + "", + "", + "telephoneCheck(\"555-555-5555\");" + ], + "MDNlinks": [ + "RegExp" + ], + "challengeType": 5, + "nameCn": "", + "descriptionCn": [], + "nameFr": "", + "descriptionFr": [], + "nameRu": "", + "descriptionRu": [], + "nameEs": "", + "descriptionEs": [], + "namePt": "", + "descriptionPt": [] + }, + { + "id": "a3f503de51cf954ede28891d", + "name": "Bonfire: Symmetric Difference", + "dashedName": "bonfire-symmetric-difference", + "difficulty": "4.02", + "description": [ + "Create a function that takes two or more arrays and returns an array of the symmetric difference of the provided arrays.", + "The mathematical term symmetric difference refers to the elements in two sets that are in either the first or second set, but not in both.", + "Remember to use RSAP if you get stuck. Try to pair program. Write your own code." + ], + "challengeSeed": [ + "function sym(args) {", + " return arguments;", + "}", + "", + "sym([1, 2, 3], [5, 2, 1, 4]);" + ], + "tests": [ + "expect(sym([1, 2, 3], [5, 2, 1, 4])).to.equal([3, 5, 4]);", + "assert.deepEqual(sym([1, 2, 5], [2, 3, 5], [3, 4, 5]), [1, 4, 5], 'should return the symmetric difference of the given arrays');", + "assert.deepEqual(sym([1, 1, 2, 5], [2, 2, 3, 5], [3, 4, 5, 5]), [1, 4, 5], 'should return an array of unique values');", + "assert.deepEqual(sym([1, 1]), [1], 'should return an array of unique values');" + ], + "MDNlinks": [ + "Array.reduce()", + "Symmetric Difference" + ], + "challengeType": 5, + "nameCn": "", + "descriptionCn": [], + "nameFr": "", + "descriptionFr": [], + "nameRu": "", + "descriptionRu": [], + "nameEs": "", + "descriptionEs": [], + "namePt": "", + "descriptionPt": [] + }, + { + "id": "aa2e6f85cab2ab736c9a9b24", + "name": "Bonfire: Exact Change", + "dashedName": "bonfire-exact-change", + "difficulty": "4.03", + "description": [ + "Design a cash register drawer function that accepts purchase price as the first argument, payment as the second argument, and cash-in-drawer (cid) as the third argument.", + "cid is a 2d array listing available currency.", + "Return the string \"Insufficient Funds\" if cash-in-drawer is less than the change due. Return the string \"Closed\" if cash-in-drawer is equal to the change due.", + "Otherwise, return change in coin and bills, sorted in highest to lowest order.", + "Remember to use RSAP if you get stuck. Try to pair program. Write your own code." + ], + "challengeSeed": [ + "function drawer(price, cash, cid) {", + " var change;", + " // Here is your change, ma'am.", + " return change;", + "}", + "", + "// Example cash-in-drawer array:", + "// [['PENNY', 1.01],", + "// ['NICKEL', 2.05],", + "// ['DIME', 3.10],", + "// ['QUARTER', 4.25],", + "// ['ONE', 90.00],", + "// ['FIVE', 55.00],", + "// ['TEN', 20.00],", + "// ['TWENTY', 60.00],", + "// ['ONE HUNDRED', 100.00]]", + "", + "drawer(19.50, 20.00, [['PENNY', 1.01], ['NICKEL', 2.05], ['DIME', 3.10], ['QUARTER', 4.25], ['ONE', 90.00], ['FIVE', 55.00], ['TEN', 20.00], ['TWENTY', 60.00], ['ONE HUNDRED', 100.00]]);" + ], + "tests": [ + "expect(drawer(19.50, 20.00, [['PENNY', 1.01], ['NICKEL', 2.05], ['DIME', 3.10], ['QUARTER', 4.25], ['ONE', 90.00], ['FIVE', 55.00], ['TEN', 20.00], ['TWENTY', 60.00], ['ONE HUNDRED', 100.00]])).to.be.a('array');", + "expect(drawer(19.50, 20.00, [['PENNY', 0.01], ['NICKEL', 0], ['DIME', 0], ['QUARTER', 0], ['ONE', 0], ['FIVE', 0], ['TEN', 0], ['TWENTY', 0], ['ONE HUNDRED', 0]])).to.be.a('string');", + "expect(drawer(19.50, 20.00, [['PENNY', 0.50], ['NICKEL', 0], ['DIME', 0], ['QUARTER', 0], ['ONE', 0], ['FIVE', 0], ['TEN', 0], ['TWENTY', 0], ['ONE HUNDRED', 0]])).to.be.a('string');", + "assert.deepEqual(drawer(19.50, 20.00, [['PENNY', 1.01], ['NICKEL', 2.05], ['DIME', 3.10], ['QUARTER', 4.25], ['ONE', 90.00], ['FIVE', 55.00], ['TEN', 20.00], ['TWENTY', 60.00], ['ONE HUNDRED', 100.00]]), [['QUARTER', 0.50]], 'return correct change');", + "assert.deepEqual(drawer(3.26, 100.00, [['PENNY', 1.01], ['NICKEL', 2.05], ['DIME', 3.10], ['QUARTER', 4.25], ['ONE', 90.00], ['FIVE', 55.00], ['TEN', 20.00], ['TWENTY', 60.00], ['ONE HUNDRED', 100.00]]), [['TWENTY', 60.00], ['TEN', 20.00], ['FIVE', 15], ['ONE', 1], ['QUARTER', 0.50], ['DIME', 0.20], ['PENNY', 0.04] ], 'return correct change with multiple coins and bills');", + "assert.deepEqual(drawer(19.50, 20.00, [['PENNY', 0.01], ['NICKEL', 0], ['DIME', 0], ['QUARTER', 0], ['ONE', 0], ['FIVE', 0], ['TEN', 0], ['TWENTY', 0], ['ONE HUNDRED', 0]]), 'Insufficient Funds', 'insufficient funds');", + "assert.deepEqual(drawer(19.50, 20.00, [['PENNY', 0.50], ['NICKEL', 0], ['DIME', 0], ['QUARTER', 0], ['ONE', 0], ['FIVE', 0], ['TEN', 0], ['TWENTY', 0], ['ONE HUNDRED', 0]]), \"Closed\", 'cash-in-drawer equals change');" + ], + "MDNlinks": [ + "Global Object" + ], + "challengeType": 5, + "nameCn": "", + "descriptionCn": [], + "nameFr": "", + "descriptionFr": [], + "nameRu": "", + "descriptionRu": [], + "nameEs": "", + "descriptionEs": [], + "namePt": "", + "descriptionPt": [] + }, + { + "id": "a56138aff60341a09ed6c480", + "name": "Bonfire: Inventory Update", + "dashedName": "bonfire-inventory-update", + "difficulty": "4.04", + "description": [ + "Compare and update inventory stored in a 2d array against a second 2d array of a fresh delivery. Update current inventory item quantity, and if an item cannot be found, add the new item and quantity into the inventory array in alphabetical order.", + "Remember to use RSAP if you get stuck. Try to pair program. Write your own code." + ], + "challengeSeed": [ + "function inventory(arr1, arr2) {", + " // All inventory must be accounted for or you're fired!", + " return arr1;", + "}", + "", + "// Example inventory lists", + "var curInv = [", + " [21, 'Bowling Ball'],", + " [2, 'Dirty Sock'],", + " [1, 'Hair Pin'],", + " [5, 'Microphone']", + "];", + "", + "var newInv = [", + " [2, 'Hair Pin'],", + " [3, 'Half-Eaten Apple'],", + " [67, 'Bowling Ball'],", + " [7, 'Toothpaste']", + "];", + "", + "inventory(curInv, newInv);" + ], + "tests": [ + "expect(inventory([[21, 'Bowling Ball'], [2, 'Dirty Sock'], [1, 'Hair Pin'], [5, 'Microphone']], [[2, 'Hair Pin'], [3, 'Half-Eaten Apple'], [67, 'Bowling Ball'], [7, 'Toothpaste']])).to.be.a('array');", + "assert.equal(inventory([[21, 'Bowling Ball'], [2, 'Dirty Sock'], [1, 'Hair Pin'], [5, 'Microphone']], [[2, 'Hair Pin'], [3, 'Half-Eaten Apple'], [67, 'Bowling Ball'], [7, 'Toothpaste']]).length, 6);", + "assert.deepEqual(inventory([[21, 'Bowling Ball'], [2, 'Dirty Sock'], [1, 'Hair Pin'], [5, 'Microphone']], [[2, 'Hair Pin'], [3, 'Half-Eaten Apple'], [67, 'Bowling Ball'], [7, 'Toothpaste']]), [[88, 'Bowling Ball'], [2, 'Dirty Sock'], [3, 'Hair Pin'], [3, 'Half-Eaten Apple'], [5, 'Microphone'], [7, 'Toothpaste']]);", + "assert.deepEqual(inventory([[21, 'Bowling Ball'], [2, 'Dirty Sock'], [1, 'Hair Pin'], [5, 'Microphone']], []), [[21, 'Bowling Ball'], [2, 'Dirty Sock'], [1, 'Hair Pin'], [5, 'Microphone']]);", + "assert.deepEqual(inventory([], [[2, 'Hair Pin'], [3, 'Half-Eaten Apple'], [67, 'Bowling Ball'], [7, 'Toothpaste']]), [[67, 'Bowling Ball'], [2, 'Hair Pin'], [3, 'Half-Eaten Apple'], [7, 'Toothpaste']]);", + "assert.deepEqual(inventory([[0, 'Bowling Ball'], [0, 'Dirty Sock'], [0, 'Hair Pin'], [0, 'Microphone']], [[1, 'Hair Pin'], [1, 'Half-Eaten Apple'], [1, 'Bowling Ball'], [1, 'Toothpaste']]), [[1, 'Bowling Ball'], [0, 'Dirty Sock'], [1, 'Hair Pin'], [1, 'Half-Eaten Apple'], [0, 'Microphone'], [1, 'Toothpaste']]);" + ], + "MDNlinks": [ + "Global Array Object" + ], + "challengeType": 5, + "nameCn": "", + "descriptionCn": [], + "nameFr": "", + "descriptionFr": [], + "nameRu": "", + "descriptionRu": [], + "nameEs": "", + "descriptionEs": [], + "namePt": "", + "descriptionPt": [] + }, + { + "id": "a7bf700cd123b9a54eef01d5", + "name": "Bonfire: No repeats please", + "dashedName": "bonfire-no-repeats-please", + "difficulty": "4.05", + "description": [ + "Return the number of total permutations of the provided string that don't have repeated consecutive letters.", + "For example, 'aab' should return 2 because it has 6 total permutations, but only 2 of them don't have the same letter (in this case 'a') repeating.", + "Remember to use RSAP if you get stuck. Try to pair program. Write your own code." + ], + "challengeSeed": [ + "function permAlone(str) {", + " return str;", + "}", + "", + "permAlone('aab');" + ], + "tests": [ + "expect(permAlone('aab')).to.be.a('number');", + "expect(permAlone('aab')).to.equal(2);", + "expect(permAlone('aaa')).to.equal(0);", + "expect(permAlone('aabb')).to.equal(8);", + "expect(permAlone('abcdefa')).to.equal(3600);", + "expect(permAlone('abfdefa')).to.equal(2640);", + "expect(permAlone('zzzzzzzz')).to.equal(0);" + ], + "MDNlinks": [ + "Permutations", + "RegExp" + ], + "challengeType": 5, + "nameCn": "", + "descriptionCn": [], + "nameFr": "", + "descriptionFr": [], + "nameRu": "", + "descriptionRu": [], + "nameEs": "", + "descriptionEs": [], + "namePt": "", + "descriptionPt": [] + }, + { + "id": "a19f0fbe1872186acd434d5a", + "name": "Bonfire: Friendly Date Ranges", + "dashedName": "bonfire-friendly-date-ranges", + "difficulty": "4.06", + "description": [ + "Implement a way of converting two dates into a more friendly date range that could be presented to a user.", + "It must not show any redundant information in the date range.", + "For example, if the year and month are the same then only the day range should be displayed.", + "Secondly, if the starting year is the current year, and the ending year can be inferred by the reader, the year should be omitted.", + "Input date is formatted as YYYY-MM-DD", + "Remember to use RSAP if you get stuck. Try to pair program. Write your own code." + ], + "challengeSeed": [ + "function friendly(str) {", + " return str;", + "}", + "", + "friendly(['2015-07-01', '2015-07-04']);" + ], + "tests": [ + "assert.deepEqual(friendly(['2015-07-01', '2015-07-04']), ['July 1st','4th'], 'ending month should be omitted since it is already mentioned');", + "assert.deepEqual(friendly(['2015-12-01', '2016-02-03']), ['December 1st','February 3rd'], 'two months apart can be inferred if it is the next year');", + "assert.deepEqual(friendly(['2015-12-01', '2017-02-03']), ['December 1st, 2015','February 3rd, 2017']);", + "assert.deepEqual(friendly(['2016-03-01', '2016-05-05']), ['March 1st','May 5th'], 'one month apart can be inferred it is the same year');", + "assert.deepEqual(friendly(['2017-01-01', '2017-01-01']), ['January 1st, 2017'], 'since we do not duplicate only return once');", + "assert.deepEqual(friendly(['2022-09-05', '2023-09-04']), ['September 5th, 2022','September 4th, 2023']);" + ], + "MDNlinks": [ + "String.split()", + "String.substr()", + "parseInt()" + ], + "challengeType": 5, + "nameCn": "", + "descriptionCn": [], + "nameFr": "", + "descriptionFr": [], + "nameRu": "", + "descriptionRu": [], + "nameEs": "", + "descriptionEs": [], + "namePt": "", + "descriptionPt": [] + } + ] +} diff --git a/seed/challenges/functional-programming.json b/seed/challenges/functional-programming.json deleted file mode 100644 index 467be534e9..0000000000 --- a/seed/challenges/functional-programming.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "name": "Functional Programming", - "order": 0.010, - "challenges": [ - { - "id": "bd7129d8c441eddfbeb5bddf", - "name": "Waypoint: Practice Functional Programming", - "dashedName": "waypoint-practice-functional-programming", - "difficulty": 0.01, - "challengeSeed": ["129169463"], - "description": [ - "Functional programming holds the key to unlocking JavaScript's powerful asynchronous features.", - "Jafar Husain's interactive Functional Programming course will familiarize you with the various ways you can recombine these functions.", - "Functional programming in JavaScript involves using five key functions: \"map\", \"reduce\", \"filter\", \"concatAll\", and \"zip\".", - "Click here to go to the challenge: http://jhusain.github.io/learnrx/.", - "You only need to complete the first 27 steps of this tutorial.", - "This challenge will take several hours, but don't worry. Jafar's website will save your progress (using your browser's local storage) so you don't need to finish it in one sitting.", - "If you've spent several minutes on one of these challenges, and still can't figure out its correct answer, you can click \"show answer\", then click \"run\" to advance to the next challenge. Be sure to read the correct answer and make sure you understand it before moving on." - ], - "challengeType": 2, - "tests": [], - "nameCn": "", - "descriptionCn": [], - "nameFr": "", - "descriptionFr": [], - "nameRu": "", - "descriptionRu": [], - "nameEs": "", - "descriptionEs": [], - "namePt": "", - "descriptionPt": [] - } - ] -} diff --git a/seed/challenges/git.json b/seed/challenges/git.json index 025ab49029..1d1ac9e1c5 100644 --- a/seed/challenges/git.json +++ b/seed/challenges/git.json @@ -1,6 +1,6 @@ { "name": "Git", - "order" : 0.012, + "order" : 0.013, "challenges": [ { "id": "bd7353d8c341eddeaeb5bd0f", diff --git a/seed/challenges/intermediate-bonfires.json b/seed/challenges/intermediate-bonfires.json index f130dc92c6..5ae11fc7a4 100644 --- a/seed/challenges/intermediate-bonfires.json +++ b/seed/challenges/intermediate-bonfires.json @@ -1,46 +1,35 @@ { "name": "Intermediate Algorithm Scripting", - "order": 0.009, + "order": 0.008, "challenges": [ { - "id": "a2f1d72d9b908d0bd72bb9f6", - "name": "Bonfire: Make a Person", - "dashedName": "bonfire-make-a-person", - "difficulty": "3.01", + "id": "a3566b1109230028080c9345", + "name": "Bonfire: Sum All Numbers in a Range", + "dashedName": "bonfire-sum-all-numbers-in-a-range", + "difficulty": "2.00", "description": [ - "Fill in the object constructor with the methods specified in the tests.", - "Those methods are getFirstName(), getLastName(), getFullName(), setFirstName(first), setLastName(last), and setFullName(firstAndLast).", - "All functions that take an argument have an arity of 1, and the argument will be a string.", - "These methods must be the only available means for interacting with the object.", + "We'll pass you an array of two numbers. Return the sum of those two numbers and all numbers between them.", + "The lowest number will not always come first.", "Remember to use RSAP if you get stuck. Try to pair program. Write your own code." ], "challengeSeed": [ - "var Person = function(firstAndLast) {", - " return firstAndLast;", - "};", + "function sumAll(arr) {", + " return(1);", + "}", "", - "var bob = new Person('Bob Ross');", - "bob.getFullName();" + "sumAll([1, 4]);" ], "tests": [ - "expect(Object.keys(bob).length).to.eql(6);", - "expect(bob instanceof Person).to.be.true;", - "expect(bob.firstName).to.be.undefined();", - "expect(bob.lastName).to.be.undefined();", - "expect(bob.getFirstName()).to.eql('Bob');", - "expect(bob.getLastName()).to.eql('Ross');", - "expect(bob.getFullName()).to.eql('Bob Ross');", - "bob.setFirstName('Happy');", - "expect(bob.getFirstName()).to.eql('Happy');", - "bob.setLastName('Trees');", - "expect(bob.getLastName()).to.eql('Trees');", - "bob.setFullName('George Carlin');", - "expect(bob.getFullName()).to.eql('George Carlin');", - "bob.setFullName('Bob Ross');" + "expect(sumAll([1, 4])).to.be.a('Number');", + "expect(sumAll([1, 4])).to.equal(10);", + "expect(sumAll([4, 1])).to.equal(10);", + "expect(sumAll([5, 10])).to.equal(45);", + "expect(sumAll([10, 5])).to.equal(45);" ], "MDNlinks": [ - "Closures", - "Details of the Object Model" + "Math.max()", + "Math.min()", + "Array.reduce()" ], "challengeType": 5, "nameCn": "", @@ -55,33 +44,530 @@ "descriptionPt": [] }, { - "id": "af4afb223120f7348cdfc9fd", - "name": "Bonfire: Map the Debris", - "dashedName": "bonfire-map-the-debris", - "difficulty": "3.02", + "id": "a5de63ebea8dbee56860f4f2", + "name": "Bonfire: Diff Two Arrays", + "dashedName": "bonfire-diff-two-arrays", + "difficulty": "2.01", "description": [ - "Return a new array that transforms the element's average altitude into their orbital periods.", - "The array will contain objects in the format {name: 'name', avgAlt: avgAlt}.", - "You can read about orbital periods on wikipedia.", - "The values should be rounded to the nearest whole number. The body being orbited is Earth.", - "The radius of the earth is 6367.4447 kilometers, and the GM value of earth is 398600.4418", + "Compare two arrays and return a new array with any items not found in both of the original arrays.", "Remember to use RSAP if you get stuck. Try to pair program. Write your own code." ], "challengeSeed": [ - "function orbitalPeriod(arr) {", - " var GM = 398600.4418;", - " var earthRadius = 6367.4447;", + "function diff(arr1, arr2) {", + " var newArr = [];", + " // Same, same; but different.", + " return newArr;", + "}", + "", + "diff([1, 2, 3, 5], [1, 2, 3, 4, 5]);" + ], + "tests": [ + "expect(diff([1, 2, 3, 5], [1, 2, 3, 4, 5])).to.be.a('array');", + "assert.deepEqual(diff(['diorite', 'andesite', 'grass', 'dirt', 'pink wool', 'dead shrub'], ['diorite', 'andesite', 'grass', 'dirt', 'dead shrub']), ['pink wool'], 'arrays with only one difference');", + "assert.includeMembers(diff(['andesite', 'grass', 'dirt', 'pink wool', 'dead shrub'], ['diorite', 'andesite', 'grass', 'dirt', 'dead shrub']), ['diorite', 'pink wool'], 'arrays with more than one difference');", + "assert.deepEqual(diff(['andesite', 'grass', 'dirt', 'dead shrub'], ['andesite', 'grass', 'dirt', 'dead shrub']), [], 'arrays with no difference');", + "assert.deepEqual(diff([1, 2, 3, 5], [1, 2, 3, 4, 5]), [4], 'arrays with numbers');", + "assert.includeMembers(diff([1, 'calf', 3, 'piglet'], [1, 'calf', 3, 4]), ['piglet', 4], 'arrays with numbers and strings');", + "assert.deepEqual(diff([], ['snuffleupagus', 'cookie monster', 'elmo']), ['snuffleupagus', 'cookie monster', 'elmo'], 'empty array');" + ], + "MDNlinks": [ + "Comparison Operators", + "String.slice()", + "Array.filter()", + "Array.indexOf()", + "String.concat()" + ], + "challengeType": 5, + "nameCn": "", + "descriptionCn": [], + "nameFr": "", + "descriptionFr": [], + "nameRu": "", + "descriptionRu": [], + "nameEs": "", + "descriptionEs": [], + "namePt": "", + "descriptionPt": [] + }, + { + "id": "a7f4d8f2483413a6ce226cac", + "name": "Bonfire: Roman Numeral Converter", + "dashedName": "bonfire-roman-numeral-converter", + "tests": [ + "expect(convert(12)).to.equal(\"XII\");", + "expect(convert(5)).to.equal(\"V\");", + "expect(convert(9)).to.equal(\"IX\");", + "expect(convert(29)).to.equal(\"XXIX\");", + "expect(convert(16)).to.equal(\"XVI\");" + ], + "difficulty": "2.02", + "description": [ + "Convert the given number into a roman numeral.", + "All roman numerals answers should be provided in upper-case.", + "Remember to use RSAP if you get stuck. Try to pair program. Write your own code." + ], + "challengeSeed": [ + "function convert(num) {", + " return num;", + "}", + "", + "convert(36);" + ], + "MDNlinks": [ + "Array.splice()", + "Array.indexOf()", + "Array.join()" + ], + "challengeType": 5, + "nameCn": "", + "descriptionCn": [], + "nameFr": "", + "descriptionFr": [], + "nameRu": "", + "descriptionRu": [], + "nameEs": "", + "descriptionEs": [], + "namePt": "", + "descriptionPt": [] + }, + { + "id": "a0b5010f579e69b815e7c5d6", + "name": "Bonfire: Search and Replace", + "dashedName": "bonfire-search-and-replace", + "tests": [ + "expect(replace(\"Let us go to the store\", \"store\", \"mall\")).to.equal(\"Let us go to the mall\");", + "expect(replace(\"He is Sleeping on the couch\", \"Sleeping\", \"sitting\")).to.equal(\"He is Sitting on the couch\");", + "expect(replace(\"This has a spellngi error\", \"spellngi\", \"spelling\")).to.equal(\"This has a spelling error\");", + "expect(replace(\"His name is Tom\", \"Tom\", \"john\")).to.equal(\"His name is John\");", + "expect(replace(\"Let us get back to more Coding\", \"Coding\", \"bonfires\")).to.equal(\"Let us get back to more Bonfires\");" + ], + "difficulty": "2.03", + "description": [ + "Perform a search and replace on the sentence using the arguments provided and return the new sentence.", + "First argument is the sentence to perform the search and replace on.", + "Second argument is the word that you will be replacing (before).", + "Third argument is what you will be replacing the second argument with (after).", + "NOTE: Preserve the case of the original word when you are replacing it. For example if you mean to replace the word 'Book' with the word 'dog', it should be replaced as 'Dog'", + "Remember to use RSAP if you get stuck. Try to pair program. Write your own code." + ], + "challengeSeed": [ + "function replace(str, before, after) {", + " return str;", + "}", + "", + "replace(\"A quick brown fox jumped over the lazy dog\", \"jumped\", \"leaped\");" + ], + "MDNlinks": [ + "Array.splice()", + "String.replace()", + "Array.join()" + ], + "challengeType": 5, + "nameCn": "", + "descriptionCn": [], + "nameFr": "", + "descriptionFr": [], + "nameRu": "", + "descriptionRu": [], + "nameEs": "", + "descriptionEs": [], + "namePt": "", + "descriptionPt": [] + }, + { + "id": "aa7697ea2477d1316795783b", + "name": "Bonfire: Pig Latin", + "dashedName": "bonfire-pig-latin", + "tests": [ + "expect(translate(\"california\")).to.equal(\"aliforniacay\");", + "expect(translate(\"paragraphs\")).to.equal(\"aragraphspay\");", + "expect(translate(\"glove\")).to.equal(\"oveglay\");", + "expect(translate(\"algorithm\")).to.equal(\"algorithmway\");", + "expect(translate(\"eight\")).to.equal(\"eightway\");" + ], + "difficulty": "2.04", + "description": [ + "Translate the provided string to pig latin.", + "Pig Latin takes the first consonant (or consonant cluster) of an English word, moves it to the end of the word and suffixes an \"ay\".", + "If a word begins with a vowel you just add \"way\" to the end.", + "Remember to use RSAP if you get stuck. Try to pair program. Write your own code." + ], + "challengeSeed": [ + "function translate(str) {", + " return str;", + "}", + "", + "translate(\"consonant\");" + ], + "MDNlinks": [ + "Array.indexOf()", + "Array.push()", + "Array.join()", + "String.substr()", + "String.split()" + ], + "challengeType": 5, + "nameCn": "", + "descriptionCn": [], + "nameFr": "", + "descriptionFr": [], + "nameRu": "", + "descriptionRu": [], + "nameEs": "", + "descriptionEs": [], + "namePt": "", + "descriptionPt": [] + }, + { + "id": "afd15382cdfb22c9efe8b7de", + "name": "Bonfire: DNA Pairing", + "dashedName": "bonfire-dna-pairing", + "tests": [ + "assert.deepEqual(pair(\"ATCGA\"),[['A','T'],['T','A'],['C','G'],['G','C'],['A','T']], 'should return the dna pair');", + "assert.deepEqual(pair(\"TTGAG\"),[['T','A'],['T','A'],['G','C'],['A','T'],['G','C']], 'should return the dna pair');", + "assert.deepEqual(pair(\"CTCTA\"),[['C','G'],['T','A'],['C','G'],['T','A'],['A','T']], 'should return the dna pair');" + ], + "difficulty": "2.05", + "description": [ + "The DNA strand is missing the pairing element. Match each character with the missing element and return the results as a 2d array.", + "Base pairs are a pair of AT and CG. Match the missing element to the provided character.", + "Return the provided character as the first element in each array.", + "Remember to use RSAP if you get stuck. Try to pair program. Write your own code." + ], + "challengeSeed": [ + "function pair(str) {", + " return str;", + "}", + "", + "pair(\"GCG\");" + ], + "MDNlinks": [ + "Array.push()", + "String.split()" + ], + "challengeType": 5, + "nameCn": "", + "descriptionCn": [], + "nameFr": "", + "descriptionFr": [], + "nameRu": "", + "descriptionRu": [], + "nameEs": "", + "descriptionEs": [], + "namePt": "", + "descriptionPt": [] + }, + { + "id": "af7588ade1100bde429baf20", + "name": "Bonfire: Missing letters", + "dashedName": "bonfire-missing-letters", + "difficulty": "2.05", + "description": [ + "Find the missing letter in the passed letter range and return it.", + "If all letters are present in the range, return undefined.", + "Remember to use RSAP if you get stuck. Try to pair program. Write your own code." + ], + "challengeSeed": [ + "function fearNotLetter(str) {", + " return str;", + "}", + "", + "fearNotLetter('abce');" + ], + "tests": [ + "expect(fearNotLetter('abce')).to.equal('d');", + "expect(fearNotLetter('bcd')).to.be.undefined;", + "expect(fearNotLetter('abcdefghjklmno')).to.equal('i');", + "expect(fearNotLetter('yz')).to.be.undefined;" + ], + "MDNlinks": [ + "String.charCodeAt()", + "String.fromCharCode()" + ], + "challengeType": 5, + "nameCn": "", + "descriptionCn": [], + "nameFr": "", + "descriptionFr": [], + "nameRu": "", + "descriptionRu": [], + "nameEs": "", + "descriptionEs": [], + "namePt": "", + "descriptionPt": [] + }, + { + "id": "a77dbc43c33f39daa4429b4f", + "name": "Bonfire: Boo who", + "dashedName": "bonfire-boo-who", + "difficulty": "2.06", + "description": [ + "Check if a value is classified as a boolean primitive. Return true or false.", + "Boolean primitives are true and false.", + "Remember to use RSAP if you get stuck. Try to pair program. Write your own code." + ], + "challengeSeed": [ + "function boo(bool) {", + " // What is the new fad diet for ghost developers? The Boolean.", + " return bool;", + "}", + "", + "boo(null);" + ], + "tests": [ + "assert.strictEqual(boo(true), true);", + "assert.strictEqual(boo(false), true);", + "assert.strictEqual(boo([1, 2, 3]), false);", + "assert.strictEqual(boo([].slice), false);", + "assert.strictEqual(boo({ 'a': 1 }), false);", + "assert.strictEqual(boo(1), false);", + "assert.strictEqual(boo(NaN), false);", + "assert.strictEqual(boo('a'), false);" + ], + "MDNlinks": [ + "Boolean Objects" + ], + "challengeType": 5, + "nameCn": "", + "descriptionCn": [], + "nameFr": "", + "descriptionFr": [], + "nameRu": "", + "descriptionRu": [], + "nameEs": "", + "descriptionEs": [], + "namePt": "", + "descriptionPt": [] + }, + { + "id": "a105e963526e7de52b219be9", + "name": "Bonfire: Sorted Union", + "dashedName": "bonfire-sorted-union", + "difficulty": "2.07", + "description": [ + "Write a function that takes two or more arrays and returns a new array of unique values in the order of the original provided arrays.", + "In other words, all values present from all arrays should be included in their original order, but with no duplicates in the final array.", + "The unique numbers should be sorted by their original order, but the final array should not be sorted in numerical order.", + "Check the assertion tests for examples.", + "Remember to use RSAP if you get stuck. Try to pair program. Write your own code." + ], + "challengeSeed": [ + "function unite(arr1, arr2, arr3) {", + " return arr1;", + "}", + "", + "unite([1, 2, 3], [5, 2, 1, 4], [2, 1]);" + ], + "tests": [ + "assert.deepEqual(unite([1, 3, 2], [5, 2, 1, 4], [2, 1]), [1, 3, 2, 5, 4], 'should return the union of the given arrays');", + "assert.deepEqual(unite([1, 3, 2], [1, [5]], [2, [4]]), [1, 3, 2, [5], [4]], 'should not flatten nested arrays');", + "assert.deepEqual(unite([1, 2, 3], [5, 2, 1]), [1, 2, 3, 5], 'should correctly handle exactly two arguments');", + "assert.deepEqual(unite([1, 2, 3], [5, 2, 1, 4], [2, 1], [6, 7, 8]), [ 1, 2, 3, 5, 4, 6, 7, 8 ], 'should correctly handle higher numbers of arguments');" + ], + "MDNlinks": [ + "Arguments object", + "Array.reduce()" + ], + "challengeType": 5, + "nameCn": "", + "descriptionCn": [], + "nameFr": "", + "descriptionFr": [], + "nameRu": "", + "descriptionRu": [], + "nameEs": "", + "descriptionEs": [], + "namePt": "", + "descriptionPt": [] + }, + { + "id": "a6b0bb188d873cb2c8729495", + "name": "Bonfire: Convert HTML Entities", + "dashedName": "bonfire-convert-html-entities", + "difficulty": "2.07", + "description": [ + "Convert the characters \"&\", \"<\", \">\", '\"' (double quote), and \"'\" (apostrophe), in a string to their corresponding HTML entities.", + "Remember to use RSAP if you get stuck. Try to pair program. Write your own code." + ], + "challengeSeed": [ + "function convert(str) {", + " // :)", + " return str;", + "}", + "", + "convert('Dolce & Gabbana');" + ], + "tests": [ + "assert.strictEqual(convert('Dolce & Gabbana'), 'Dolce & Gabbana', 'should escape characters');", + "assert.strictEqual(convert('Hamburgers < Pizza < Tacos'), 'Hamburgers < Pizza < Tacos', 'should escape characters');", + "assert.strictEqual(convert('Sixty > twelve'), 'Sixty > twelve', 'should escape characters');", + "assert.strictEqual(convert('Stuff in \"quotation marks\"'), 'Stuff in "quotation marks"', 'should escape characters');", + "assert.strictEqual(convert(\"Shindler's List\"), 'Shindler's List', 'should escape characters');", + "assert.strictEqual(convert('<>'), '<>', 'should escape characters');", + "assert.strictEqual(convert('abc'), 'abc', 'should handle strings with nothing to escape');" + ], + "MDNlinks": [ + "RegExp", + "HTML Entities" + ], + "challengeType": 5, + "nameCn": "", + "descriptionCn": [], + "nameFr": "", + "descriptionFr": [], + "nameRu": "", + "descriptionRu": [], + "nameEs": "", + "descriptionEs": [], + "namePt": "", + "descriptionPt": [] + }, + { + "id": "a103376db3ba46b2d50db289", + "name": "Bonfire: Spinal Tap Case", + "dashedName": "bonfire-spinal-tap-case", + "difficulty": "2.08", + "description": [ + "Convert a string to spinal case. Spinal case is all-lowercase-words-joined-by-dashes.", + "Remember to use RSAP if you get stuck. Try to pair program. Write your own code." + ], + "challengeSeed": [ + "function spinalCase(str) {", + " // \"It's such a fine line between stupid, and clever.\"", + " // --David St. Hubbins", + " return str;", + "}", + "", + "spinalCase('This Is Spinal Tap');" + ], + "tests": [ + "assert.strictEqual(spinalCase('This Is Spinal Tap'), 'this-is-spinal-tap', 'should return spinal case from string with spaces');", + "assert.strictEqual(spinalCase('thisIsSpinalTap'), 'this-is-spinal-tap', 'should return spinal case from string with camel case');", + "assert.strictEqual(spinalCase('The_Andy_Griffith_Show'), 'the-andy-griffith-show', 'should return spinal case from string with snake case');", + "assert.strictEqual(spinalCase('Teletubbies say Eh-oh'), 'teletubbies-say-eh-oh', 'should return spinal case from string with spaces and hyphens');" + ], + "MDNlinks": [ + "RegExp", + "String.replace()" + ], + "challengeType": 5, + "nameCn": "", + "descriptionCn": [], + "nameFr": "", + "descriptionFr": [], + "nameRu": "", + "descriptionRu": [], + "nameEs": "", + "descriptionEs": [], + "namePt": "", + "descriptionPt": [] + }, + { + "id": "a5229172f011153519423690", + "name": "Bonfire: Sum All Odd Fibonacci Numbers", + "dashedName": "bonfire-sum-all-odd-fibonacci-numbers", + "difficulty": "2.09", + "description": [ + "Return the sum of all odd Fibonacci numbers up to and including the passed number if it is a Fibonacci number.", + "The first few numbers of the Fibonacci sequence are 1, 1, 2, 3, 5 and 8, and each subsequent number is the sum of the previous two numbers.", + "As an example, passing 4 to the function should return 5 because all the odd Fibonacci numbers under 4 are 1, 1, and 3.", + "Remember to use RSAP if you get stuck. Try to pair program. Write your own code." + ], + "challengeSeed": [ + "function sumFibs(num) {", + " return num;", + "}", + "", + "sumFibs(4);" + ], + "tests": [ + "expect(sumFibs(1)).to.be.a('number');", + "expect(sumFibs(1000)).to.equal(1785);", + "expect(sumFibs(4000000)).to.equal(4613732);", + "expect(sumFibs(4)).to.equal(5);", + "expect(sumFibs(75024)).to.equal(60696);", + "expect(sumFibs(75025)).to.equal(135721);" + ], + "MDNlinks": [ + "Remainder" + ], + "challengeType": 5, + "nameCn": "", + "descriptionCn": [], + "nameFr": "", + "descriptionFr": [], + "nameRu": "", + "descriptionRu": [], + "nameEs": "", + "descriptionEs": [], + "namePt": "", + "descriptionPt": [] + }, + { + "id": "a3bfc1673c0526e06d3ac698", + "name": "Bonfire: Sum All Primes", + "dashedName": "bonfire-sum-all-primes", + "difficulty": "2.10", + "description": [ + "Sum all the prime numbers up to and including the provided number.", + "A prime number is defined as having only two divisors, 1 and itself. For example, 2 is a prime number because it's only divisible by 1 and 2. 1 isn't a prime number, because it's only divisible by itself.", + "The provided number may not be a prime.", + "Remember to use RSAP if you get stuck. Try to pair program. Write your own code." + ], + "challengeSeed": [ + "function sumPrimes(num) {", + " return num;", + "}", + "", + "sumPrimes(10);" + ], + "tests": [ + "expect(sumPrimes(10)).to.be.a('number');", + "expect(sumPrimes(10)).to.equal(17);", + "expect(sumPrimes(977)).to.equal(73156);" + ], + "MDNlinks": [ + "For Loops", + "Array.push()" + ], + "challengeType": 5, + "nameCn": "", + "descriptionCn": [], + "nameFr": "", + "descriptionFr": [], + "nameRu": "", + "descriptionRu": [], + "nameEs": "", + "descriptionEs": [], + "namePt": "", + "descriptionPt": [] + }, + { + "id": "ae9defd7acaf69703ab432ea", + "name": "Bonfire: Smallest Common Multiple", + "dashedName": "bonfire-smallest-common-multiple", + "difficulty": "2.11", + "description": [ + "Find the smallest number that is evenly divisible by all numbers in the provided range.", + "The range will be an array of two numbers that will not necessarily be in numerical order.", + "Remember to use RSAP if you get stuck. Try to pair program. Write your own code." + ], + "challengeSeed": [ + "function smallestCommons(arr) {", " return arr;", "}", "", - "orbitalPeriod([{name : \"sputkin\", avgAlt : 35873.5553}]);" + "", + "smallestCommons([1,5]);" ], "tests": [ - "expect(orbitalPeriod([{name : \"sputkin\", avgAlt : 35873.5553}])).to.eqls([{name: \"sputkin\", orbitalPeriod: 86400}]);", - "expect(orbitalPeriod([{name: \"iss\", avgAlt: 413.6}, {name: \"hubble\", avgAlt: 556.7}, {name: \"moon\", avgAlt: 378632.553}])).to.eqls([{name : \"iss\", orbitalPeriod: 5557}, {name: \"hubble\", orbitalPeriod: 5734}, {name: \"moon\", orbitalPeriod: 2377399}]);" + "expect(smallestCommons([1,5])).to.be.a('number');", + "expect(smallestCommons([1,5])).to.equal(60);", + "expect(smallestCommons([5,1])).to.equal(60);", + "expect(smallestCommons([1,13])).to.equal(360360);" ], "MDNlinks": [ - "Math.pow()" + "Smallest Common Multiple" ], "challengeType": 5, "nameCn": "", @@ -96,32 +582,222 @@ "descriptionPt": [] }, { - "id": "a3f503de51cfab748ff001aa", - "name": "Bonfire: Pairwise", - "dashedName": "bonfire-pairwise", - "difficulty": "3.03", + "id": "a6e40f1041b06c996f7b2406", + "name": "Bonfire: Finders Keepers", + "dashedName": "bonfire-finders-keepers", + "difficulty": "2.12", "description": [ - "Return the sum of all indices of elements of 'arr' that can be paired with one other element to form a sum that equals the value in the second argument 'arg'. If multiple sums are possible, return the smallest sum. Once an element has been used, it cannot be reused to pair with another.", - "For example, pairwise([1, 4, 2, 3, 0, 5], 7) should return 11 because 4, 2, 3 and 5 can be paired with each other to equal 7.", - "pairwise([1, 3, 2, 4], 4) would only equal 1, because only the first two elements can be paired to equal 4, and the first element has an index of 0!", + "Create a function that looks through an array (first argument) and returns the first element in the array that passes a truth test (second argument).", "Remember to use RSAP if you get stuck. Try to pair program. Write your own code." ], "challengeSeed": [ - "function pairwise(arr, arg) {", - " return arg;", + "function find(arr, func) {", + " var num = 0;", + " return num;", "}", "", - "pairwise([1,4,2,3,0,5], 7);" + "find([1, 2, 3, 4], function(num){ return num % 2 === 0; });" ], "tests": [ - "expect(pairwise([1, 4, 2, 3, 0, 5], 7)).to.equal(11);", - "expect(pairwise([1, 3, 2, 4], 4)).to.equal(1);", - "expect(pairwise([1,1,1], 2)).to.equal(1);", - "expect(pairwise([0, 0, 0, 0, 1, 1], 1)).to.equal(10);", - "expect(pairwise([], 100)).to.equal(0);" + "assert.strictEqual(find([1, 3, 5, 8, 9, 10], function(num) { return num % 2 === 0; }), 8, 'should return first found value');", + "assert.strictEqual(find([1, 3, 5, 9], function(num) { return num % 2 === 0; }), undefined, 'should return undefined if not found');" ], "MDNlinks": [ - "Array.reduce()" + "Array.some()" + ], + "challengeType": 5, + "nameCn": "", + "descriptionCn": [], + "nameFr": "", + "descriptionFr": [], + "nameRu": "", + "descriptionRu": [], + "nameEs": "", + "descriptionEs": [], + "namePt": "", + "descriptionPt": [] + }, + { + "id": "a5deed1811a43193f9f1c841", + "name": "Bonfire: Drop it", + "dashedName": "bonfire-drop-it", + "difficulty": "2.13", + "description": [ + "Drop the elements of an array (first argument), starting from the front, until the predicate (second argument) returns true.", + "Remember to use RSAP if you get stuck. Try to pair program. Write your own code." + ], + "challengeSeed": [ + "function drop(arr, func) {", + " // Drop them elements.", + " return arr;", + "}", + "", + "drop([1, 2, 3], function(n) {return n < 3; });" + ], + "tests": [ + "expect(drop([1, 2, 3, 4], function(n) {return n >= 3; })).to.eqls([3, 4]);", + "expect(drop([1, 2, 3], function(n) {return n > 0; })).to.eqls([1, 2, 3]);", + "expect(drop([1, 2, 3, 4], function(n) {return n > 5; })).to.eqls([]);" + ], + "MDNlinks": [ + "Arguments object", + "Array.shift()" + ], + "challengeType": 5, + "nameCn": "", + "descriptionCn": [], + "nameFr": "", + "descriptionFr": [], + "nameRu": "", + "descriptionRu": [], + "nameEs": "", + "descriptionEs": [], + "namePt": "", + "descriptionPt": [] + }, + { + "id": "ab306dbdcc907c7ddfc30830", + "name": "Bonfire: Steamroller", + "dashedName": "bonfire-steamroller", + "difficulty": "2.14", + "description": [ + "Flatten a nested array. You must account for varying levels of nesting.", + "Remember to use RSAP if you get stuck. Try to pair program. Write your own code." + ], + "challengeSeed": [ + "function steamroller(arr) {", + " // I'm a steamroller, baby", + " return arr;", + "}", + "", + "steamroller([1, [2], [3, [[4]]]]);" + ], + "tests": [ + "assert.deepEqual(steamroller([[['a']], [['b']]]), ['a', 'b'], 'should flatten nested arrays');", + "assert.deepEqual(steamroller([1, [2], [3, [[4]]]]), [1, 2, 3, 4], 'should flatten nested arrays');", + "assert.deepEqual(steamroller([1, [], [3, [[4]]]]), [1, 3, 4], 'should work with empty arrays');" + ], + "MDNlinks": [ + "Array.isArray()" + ], + "challengeType": 5, + "nameCn": "", + "descriptionCn": [], + "nameFr": "", + "descriptionFr": [], + "nameRu": "", + "descriptionRu": [], + "nameEs": "", + "descriptionEs": [], + "namePt": "", + "descriptionPt": [] + }, + { + "id": "a8d97bd4c764e91f9d2bda01", + "name": "Bonfire: Binary Agents", + "dashedName": "bonfire-binary-agents", + "difficulty": "2.15", + "description": [ + "Return an English translated sentence of the passed binary string.", + "The binary string will be space separated.", + "Remember to use RSAP if you get stuck. Try to pair program. Write your own code." + ], + "challengeSeed": [ + "function binaryAgent(str) {", + " return str;", + "}", + "", + "binaryAgent('01000001 01110010 01100101 01101110 00100111 01110100 00100000 01100010 01101111 01101110 01100110 01101001 01110010 01100101 01110011 00100000 01100110 01110101 01101110 00100001 00111111');" + ], + "tests": [ + "expect(binaryAgent('01000001 01110010 01100101 01101110 00100111 01110100 00100000 01100010 01101111 01101110 01100110 01101001 01110010 01100101 01110011 00100000 01100110 01110101 01101110 00100001 00111111')).to.equal(\"Aren't bonfires fun!?\");", + "expect(binaryAgent('01001001 00100000 01101100 01101111 01110110 01100101 00100000 01000110 01110010 01100101 01100101 01000011 01101111 01100100 01100101 01000011 01100001 01101101 01110000 00100001')).to.equal(\"I love FreeCodeCamp!\");" + ], + "MDNlinks": [ + "String.charCodeAt()", + "String.fromCharCode()" + ], + "challengeType": 5, + "nameCn": "", + "descriptionCn": [], + "nameFr": "", + "descriptionFr": [], + "nameRu": "", + "descriptionRu": [], + "nameEs": "", + "descriptionEs": [], + "namePt": "", + "descriptionPt": [] + }, + { + "id": "a10d2431ad0c6a099a4b8b52", + "name": "Bonfire: Everything Be True", + "dashedName": "bonfire-everything-be-true", + "difficulty": "2.21", + "description": [ + "Check if the predicate (second argument) returns truthy (defined) for all elements of a collection (first argument).", + "For this, check to see if the property defined in the second argument is present on every element of the collection.", + "Remember, you can access object properties through either dot notation or [] notation.", + "Remember to use RSAP if you get stuck. Try to pair program. Write your own code." + ], + "challengeSeed": [ + "function every(collection, pre) {", + " // Does everyone have one of these?", + " return pre;", + "}", + "", + "every([{'user': 'Tinky-Winky', 'sex': 'male'}, {'user': 'Dipsy', 'sex': 'male'}, {'user': 'Laa-Laa', 'sex': 'female'}, {'user': 'Po', 'sex': 'female'}], 'sex');" + ], + "tests": [ + "assert.strictEqual(every([{'user': 'Tinky-Winky', 'sex': 'male'}, {'user': 'Dipsy', 'sex': 'male'}, {'user': 'Laa-Laa', 'sex': 'female'}, {'user': 'Po', 'sex': 'female'}], 'sex'), true, 'should return true if predicate returns truthy for all elements in the collection');", + "assert.strictEqual(every([{'user': 'Tinky-Winky', 'sex': 'male'}, {'user': 'Dipsy', 'sex': 'male'}, {'user': 'Laa-Laa', 'sex': 'female'}, {'user': 'Po', 'sex': 'female'}], {'sex': 'female'}), false, 'should return false if predicate returns falsey for any element in the collection');", + "assert.strictEqual(every([{'user': 'Tinky-Winky', 'sex': 'female'}, {'user': 'Dipsy', 'sex': 'male'}, {'user': 'Laa-Laa', 'sex': 'female'}, {'user': 'Po', 'sex': 'female'}], {'sex': 'female'}), false, 'should return false if predicate returns falsey for any element in the collection');" + + ], + "MDNlinks": [ + "Object.hasOwnProperty()", + "Object.getOwnPropertyNames()" + ], + "challengeType": 5, + "nameCn": "", + "descriptionCn": [], + "nameFr": "", + "descriptionFr": [], + "nameRu": "", + "descriptionRu": [], + "nameEs": "", + "descriptionEs": [], + "namePt": "", + "descriptionPt": [] + }, + { + "id": "a97fd23d9b809dac9921074f", + "name": "Bonfire: Arguments Optional", + "dashedName": "bonfire-arguments-optional", + "difficulty": "2.22", + "description": [ + "Create a function that sums two arguments together. If only one argument is provided, return a function that expects one additional argument and will return the sum.", + "For example, add(2, 3) should return 5, and add(2) should return a function that is waiting for an argument so that var sum2And = add(2); return sum2And(3); // 5", + "If either argument isn't a valid number, return undefined.", + "Remember to use RSAP if you get stuck. Try to pair program. Write your own code." + ], + "challengeSeed": [ + "function add() {", + " return false;", + "}", + "", + "add(2,3);" + ], + "tests": [ + "expect(add(2, 3)).to.equal(5);", + "expect(add(2)(3)).to.equal(5);", + "expect(add('http://bit.ly/IqT6zt')).to.be.undefined;", + "expect(add(2, '3')).to.be.undefined;", + "expect(add(2)([3])).to.be.undefined;" + ], + "MDNlinks": [ + "Global Function Object", + "Arguments object" ], "challengeType": 5, "nameCn": "", diff --git a/seed/challenges/intermediate-ziplines.json b/seed/challenges/intermediate-ziplines.json index f06bc15efc..bba888f2cf 100644 --- a/seed/challenges/intermediate-ziplines.json +++ b/seed/challenges/intermediate-ziplines.json @@ -1,6 +1,6 @@ { "name": "Intermediate Front End Development Projects", - "order": 0.016, + "order": 0.017, "challenges": [ { "id": "bd7158d8c442eddfaeb5bd18", diff --git a/seed/challenges/mongodb.json b/seed/challenges/mongodb.json index 590fe3d6f2..4a9c9ce973 100644 --- a/seed/challenges/mongodb.json +++ b/seed/challenges/mongodb.json @@ -1,6 +1,6 @@ { "name": "MongoDB", - "order" : 0.014, + "order" : 0.015, "challenges": [ { "id": "bd7243d8c341eddeaeb5bd0f", diff --git a/seed/challenges/nodejs-and-expressjs.json b/seed/challenges/nodejs-and-expressjs.json index 10da3ae8c2..9d4282e8f7 100644 --- a/seed/challenges/nodejs-and-expressjs.json +++ b/seed/challenges/nodejs-and-expressjs.json @@ -1,6 +1,6 @@ { "name": "Node.js and Express.js", - "order" : 0.013, + "order" : 0.014, "challenges": [ { "id": "bd7153d8c441eddfaeb5bd0f", diff --git a/seed/challenges/object-oriented-programming.json b/seed/challenges/object-oriented-and-functional-programming.json similarity index 74% rename from seed/challenges/object-oriented-programming.json rename to seed/challenges/object-oriented-and-functional-programming.json index 11e3ad65e0..6ef66c0c9b 100644 --- a/seed/challenges/object-oriented-programming.json +++ b/seed/challenges/object-oriented-and-functional-programming.json @@ -1,6 +1,6 @@ { - "name": "Object Oriented Programming", - "order" : 0.008, + "name": "Object Oriented and Functional Programming", + "order" : 0.009, "challenges": [ { "id": "bd7153d8c44eeddfaeb5bd0f", @@ -86,6 +86,34 @@ "descriptionEs": [], "namePt": "", "descriptionPt": [] + }, + { + "id": "bd7129d8c441eddfbeb5bddf", + "name": "Waypoint: Practice Functional Programming", + "dashedName": "waypoint-practice-functional-programming", + "difficulty": 0.01, + "challengeSeed": ["129169463"], + "description": [ + "Functional programming holds the key to unlocking JavaScript's powerful asynchronous features.", + "Jafar Husain's interactive Functional Programming course will familiarize you with the various ways you can recombine these functions.", + "Functional programming in JavaScript involves using five key functions: \"map\", \"reduce\", \"filter\", \"concatAll\", and \"zip\".", + "Click here to go to the challenge: http://jhusain.github.io/learnrx/.", + "You only need to complete the first 27 steps of this tutorial.", + "This challenge will take several hours, but don't worry. Jafar's website will save your progress (using your browser's local storage) so you don't need to finish it in one sitting.", + "If you've spent several minutes on one of these challenges, and still can't figure out its correct answer, you can click \"show answer\", then click \"run\" to advance to the next challenge. Be sure to read the correct answer and make sure you understand it before moving on." + ], + "challengeType": 2, + "tests": [], + "nameCn": "", + "descriptionCn": [], + "nameFr": "", + "descriptionFr": [], + "nameRu": "", + "descriptionRu": [], + "nameEs": "", + "descriptionEs": [], + "namePt": "", + "descriptionPt": [] } ] }