freeCodeCamp/seed_data/bonfires.json

59 lines
3.2 KiB
JSON
Raw Normal View History

[
{
"_id" : "aaa48de84e1ecc7c742e1124",
"name": "Palindrome Tester",
"difficulty": 1,
"description": [
"Your job is to determine if a provided string is a palindrome.",
"The definition of a palindrome can be found at http://en.wikipedia.org/wiki/Palindrome.",
"Strings will be passed in with varying formats, such as \"racecar\", \"RaceCar\", and \"race CAR\" among others.",
"Return true if the string is a palindrome, otherwise false"
],
"tests": [
"expect(palindrome(\"eye\")).to.be.a(\"boolean\");",
"assert.deepEqual(palindrome(\"eye\"), true);",
"assert.deepEqual(palindrome(\"race car\"), true);",
"assert.deepEqual(palindrome(\"not a palindrome\"), false);",
"assert.deepEqual(palindrome(\"A man, a plan, a canal. Panama\"), true);",
"assert.deepEqual(palindrome(\"never odd or even\"), true);",
"assert.deepEqual(palindrome(\"nope\"), false);"
],
"challengeSeed": "function palindrome(str) {\n // Good luck!\n return true;\n}\n\n",
"challengeEntryPoint": "palindrome(\"eye\");",
"bonfireNumber": 1,
"challengeEntryPointNegate" : "palindrome\\([^str].*\\;"
},
{
"_id" : "ff0395860f5d3034dc0bfc94",
"name": "Validate US Telephone Numbers",
"difficulty": 3,
"description": [
"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 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."
],
"tests": [
"expect(telephoneCheck(\"555-555-5555\")).to.be.a(\"boolean\");",
"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) {\n // Good luck!\n return true;\n}\n\n",
"challengeEntryPoint": "telephoneCheck(\"555-555-5555\");",
"bonfireNumber": 2,
"challengeEntryPointNegate" : "palindrome\\([^str].*\\;"
}
]