added 5 new bonfires

This commit is contained in:
Geoff Storbeck
2015-03-30 23:27:09 -04:00
parent f9523beb29
commit 46d185a503

View File

@ -302,6 +302,68 @@
"assert.deepEqual(diff([], ['snuffleupagus', 'cookie monster', 'elmo']), ['snuffleupagus', 'cookie monster', 'elmo'], 'empty array');"
]
},
{
"_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\");"
],
"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"
],
"challengeSeed": "function convert(num) {\n return num;\r\n}\n\nconvert(36);"
},
{
"_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(\"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\");"
],
"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"
],
"challengeSeed": "function replace(str, before, after) {\n return str;\r\n}\n\nreplace(\"A quick brown fox jumped over the lazy dog\", \"jumped\", \"leaped\");"
},
{
"_id": "aa7697ea2477d1316795783b",
"name": "Pig Latin",
"tests": [
"expect(translate(\"California\")).to.equal(\"Aliforniacay\");",
"expect(translate(\"paragraphs\")).to.equal(\"aragraphspay\");",
"expect(translate(\"algorithm\")).to.equal(\"algorithmway\");"
],
"difficulty": "2.04",
"description": [
"Translate the provided string to pig latin"
],
"challengeSeed": "function translate(str) {\n return str;\r\n}\n\ntranslate(\"consonant\");"
},
{
"_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": [
"Translate the DNA string and create a 2D array of base pairs",
"Return the provided character as the first element in each array."
],
"challengeSeed": "function pair(str) {\n return str;\r\n}\n\npair(\"GCG\");"
},
{
"_id": "af7588ade1100bde429baf20",
"name" : "Missing letters",
@ -669,5 +731,26 @@
"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']);"
]
}
]