Updated language and added more test cases
parent
46d185a503
commit
003f6c6c0a
|
@ -239,7 +239,7 @@
|
|||
"assert.deepEqual(where([{ first: 'Romeo', last: 'Montague' }, { first: 'Mercutio', last: null }, { first: 'Tybalt', last: 'Capulet' }], { last: 'Capulet' }), [{ first: 'Tybalt', last: 'Capulet' }], 'should return an array of objects');",
|
||||
"assert.deepEqual(where([{ 'a': 1 }, { 'a': 1 }, { 'a': 1, 'b': 2 }], { 'a': 1 }), [{ 'a': 1 }, { 'a': 1 }, { 'a': 1, 'b': 2 }], 'should return with multiples');"
|
||||
]
|
||||
},
|
||||
},
|
||||
{
|
||||
"_id":"a39963a4c10bc8b4d4f06d7e",
|
||||
"name":"Seek and Destroy",
|
||||
|
@ -306,15 +306,16 @@
|
|||
"_id": "a7f4d8f2483413a6ce226cac",
|
||||
"name": "Roman Numeral Converter",
|
||||
"tests": [
|
||||
"expect(convert(\"xii\")).to.equal(12);",
|
||||
"expect(convert(\"XLII\")).to.equal(42);",
|
||||
"expect(convert(9)).to.equal(\"IX\");"
|
||||
"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 between roman numerals and numbers depending on the input given.",
|
||||
"If input is given a roman numeral return the integer equivalent",
|
||||
"If input is given in an integer give the roman numeral equivalent"
|
||||
"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);"
|
||||
},
|
||||
|
@ -322,16 +323,18 @@
|
|||
"_id": "a0b5010f579e69b815e7c5d6",
|
||||
"name": "Search and Replace",
|
||||
"tests": [
|
||||
"expect(replace(\"Let's go to the store\", \"store\", \"mall\")).to.equal(\"Let's go to the mall\");",
|
||||
"expect(replace(\"He's sleeping on the couch\", \"sleeping\", \"sitting\")).to.equal(\"He's sitting on the couch\");",
|
||||
"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(\"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 a string",
|
||||
"Use the second argument as the before and the third as the after",
|
||||
"Note: Keep the same capitalization on the new word as the old word"
|
||||
"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\");"
|
||||
},
|
||||
|
@ -339,13 +342,17 @@
|
|||
"_id": "aa7697ea2477d1316795783b",
|
||||
"name": "Pig Latin",
|
||||
"tests": [
|
||||
"expect(translate(\"California\")).to.equal(\"Aliforniacay\");",
|
||||
"expect(translate(\"california\")).to.equal(\"aliforniacay\");",
|
||||
"expect(translate(\"paragraphs\")).to.equal(\"aragraphspay\");",
|
||||
"expect(translate(\"algorithm\")).to.equal(\"algorithmway\");"
|
||||
"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"
|
||||
"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\");"
|
||||
},
|
||||
|
@ -359,7 +366,8 @@
|
|||
],
|
||||
"difficulty": "2.05",
|
||||
"description": [
|
||||
"Translate the DNA string and create a 2D array of base pairs",
|
||||
"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\");"
|
||||
|
|
Loading…
Reference in New Issue