resolve merge conflict
This commit is contained in:
@ -1,7 +1,7 @@
|
||||
// MDN Links
|
||||
|
||||
/* These links are for Bonfires. Each key/value pair is used to render a Bonfire with approrpiate links.
|
||||
|
||||
|
||||
|
||||
The text of the key is what the link text will be, e.g. <a href="https://developer ...">Global Array Object</a>
|
||||
General convention is to use the page title of the MDN reference page.
|
||||
@ -16,9 +16,13 @@ var links =
|
||||
"RegExp" : "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp",
|
||||
"Arguments object" : "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/arguments",
|
||||
|
||||
// ========= GLOBAL OBJECT METHODS
|
||||
"parseInt()" : "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/parseInt",
|
||||
|
||||
|
||||
// ========= PROPERTIES/MISC
|
||||
"String.length" : "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/length",
|
||||
|
||||
|
||||
|
||||
// ========== OBJECT METHODS
|
||||
"Object.getOwnPropertyNames()" : "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/getOwnPropertyNames",
|
||||
@ -62,13 +66,13 @@ var links =
|
||||
"Array.sort()" : "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort",
|
||||
"Array.splice()" : "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/splice",
|
||||
"Array.toString()" : "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/toString",
|
||||
|
||||
|
||||
// ======== MATH METHODS
|
||||
"Math.max()" : "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/max",
|
||||
"Math.min()" : "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/min",
|
||||
"Math.pow()" : "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/pow",
|
||||
"Remainder" : "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Arithmetic_Operators#Remainder_(.25)",
|
||||
|
||||
|
||||
// ======== GENERAL JAVASCRIPT REFERENCES
|
||||
"Arithmetic Operators" : "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Arithmetic_Operators",
|
||||
"Comparison Operators" : "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Comparison_Operators",
|
||||
|
@ -318,6 +318,80 @@
|
||||
"assert.deepEqual(diff([], ['snuffleupagus', 'cookie monster', 'elmo']), ['snuffleupagus', 'cookie monster', 'elmo'], 'empty array');"
|
||||
]
|
||||
},
|
||||
{
|
||||
"_id": "a7f4d8f2483413a6ce226cac",
|
||||
"name": "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 number be a roman numeral.",
|
||||
"All <a href=\"http://www.mathsisfun.com/roman-numerals.html\">roman numerals</a> answers should be provided in upper-case."
|
||||
],
|
||||
"challengeSeed": "function convert(num) {\n return num;\r\n}\n\nconvert(36);",
|
||||
"MDNlinks" : ["Array.splice()", "Array.indexOf()", "Array.join()"]
|
||||
},
|
||||
{
|
||||
"_id": "a0b5010f579e69b815e7c5d6",
|
||||
"name": "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 the 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)."
|
||||
],
|
||||
"challengeSeed": "function replace(str, before, after) {\n return str;\r\n}\n\nreplace(\"A quick brown fox jumped over the lazy dog\", \"jumped\", \"leaped\");",
|
||||
"MDNlinks" : ["Array.splice()", "String.replace()", "Array.join()"]
|
||||
},
|
||||
{
|
||||
"_id": "aa7697ea2477d1316795783b",
|
||||
"name": "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.",
|
||||
"<a href=\"http://en.wikipedia.org/wiki/Pig_Latin\">Pig Latin</a> 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."
|
||||
],
|
||||
"challengeSeed": "function translate(str) {\n return str;\r\n}\n\ntranslate(\"consonant\");",
|
||||
"MDNlinks" : ["Array.indexOf()", "Array.push()", "Array.join()", "String.substr()", "String.split()"]
|
||||
},
|
||||
{
|
||||
"_id": "afd15382cdfb22c9efe8b7de",
|
||||
"name": "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.",
|
||||
"<a href=\"http://en.wikipedia.org/wiki/Base_pair\">Base pairs</a> 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."
|
||||
],
|
||||
"challengeSeed": "function pair(str) {\n return str;\r\n}\n\npair(\"GCG\");",
|
||||
"MDNlinks" : ["Array.push()", "String.split()"]
|
||||
},
|
||||
{
|
||||
"_id": "af7588ade1100bde429baf20",
|
||||
"name" : "Missing letters",
|
||||
@ -697,5 +771,27 @@
|
||||
"expect(permAlone('abfdefa')).to.equal(2640);",
|
||||
"expect(permAlone('zzzzzzzz')).to.equal(0);"
|
||||
]
|
||||
},
|
||||
{
|
||||
"_id": "a19f0fbe1872186acd434d5a",
|
||||
"name": "Friendly Date Ranges",
|
||||
"difficulty": "4.05",
|
||||
"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"
|
||||
],
|
||||
"challengeSeed": "function friendly(str) {\n return str;\n}\n\nfriendly(['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'], 'one month apart can be inferred 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, 2016']);",
|
||||
"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()"]
|
||||
}
|
||||
]
|
||||
|
Reference in New Issue
Block a user