diff --git a/challenges/01-front-end-development-certification/basic-bonfires.json b/challenges/01-front-end-development-certification/basic-bonfires.json index 220799db54..08e66bacb6 100644 --- a/challenges/01-front-end-development-certification/basic-bonfires.json +++ b/challenges/01-front-end-development-certification/basic-bonfires.json @@ -808,6 +808,51 @@ ], "namePt": "", "descriptionPt": [] + }, + { + "id": "56533eb9ac21ba0edf2244e2", + "title": "Caesar's Cipher", + "description": [ + "One of the simplest and most widely known ciphers is a Caesar cipher, also known as a shift cipher. In a shift cipher the meanings of the letters are shifted by some set amount.", + "A common modern use is the ROT13 cipher, where the values of the letters are shifted by 13 places. Thus 'A' ↔ 'N', 'B' ↔ 'O' and so on.", + "Write a function which takes a ROT13 encoded string as input and returns a decoded string. All letters will be uppercase. Do not transform any non-alphabetic character (i.e. spaces, punctuation), but do pass them on.", + "The provided code transforms the input into an array for you, codeArr. Place the decoded values into the decodedArr array where the provided code will transform it back into a string." + ], + "releasedOn": "January 1, 2016", + "challengeSeed": [ + "function rot13(encodedStr) {", + " var codeArr = encodedStr.split(\"\"); // String to Array", + " var decodedArr = []; // Your Result goes here", + " // Only change code below this line", + " ", + " ", + " ", + " // Only change code above this line", + " return decodedArr.join(\"\"); // Array to String", + "}", + "", + "// Change the inputs below to test", + "rot13(\"SERR PBQR PNZC\");" + ], + "tail": [ + "" + ], + "solutions": [ + "var lookup = {\n 'A': 'N','B': 'O','C': 'P','D': 'Q',\n 'E': 'R','F': 'S','G': 'T','H': 'U',\n 'I': 'V','J': 'W','K': 'X','L': 'Y',\n 'M': 'Z','N': 'A','O': 'B','P': 'C',\n 'Q': 'D','R': 'E','S': 'F','T': 'G',\n 'U': 'H','V': 'I','W': 'J','X': 'K',\n 'Y': 'L','Z': 'M' \n};\n\nfunction rot13(encodedStr) {\n var codeArr = encodedStr.split(\"\"); // String to Array\n var decodedArr = []; // Your Result goes here\n // Only change code below this line\n \n decodedArr = codeArr.map(function(letter) {\n if(lookup.hasOwnProperty(letter)) {\n letter = lookup[letter];\n }\n return letter;\n });\n\n // Only change code above this line\n return decodedArr.join(\"\"); // Array to String\n}" + ], + "tests": [ + "assert(rot13(\"SERR PBQR PNZC\") === \"FREE CODE CAMP\", 'message: rot13(\"SERR PBQR PNZC\") should decode to \"FREE CODE CAMP\"');", + "assert(rot13(\"SERR CVMMN!\") === \"FREE PIZZA!\", 'message: rot13(\"SERR CVMMN!\") should decode to \"FREE PIZZA!\"');", + "assert(rot13(\"SERR YBIR?\") === \"FREE LOVE?\", 'message: rot13(\"SERR YBIR?\") should decode to \"FREE LOVE?\"');", + "assert(rot13(\"GUR DHVPX OEBJA QBT WHZCRQ BIRE GUR YNML SBK.\") === \"THE QUICK BROWN DOG JUMPED OVER THE LAZY FOX.\", 'message: rot13(\"GUR DHVPX OEBJA QBT WHZCRQ BIRE GUR YNML SBK.\") should decode to \"THE QUICK BROWN DOG JUMPED OVER THE LAZY FOX.\"');" + ], + "type": "bonfire", + "challengeType": "5", + "nameCn": "", + "nameFr": "", + "nameRu": "", + "nameEs": "", + "namePt": "" } ] } diff --git a/challenges/01-front-end-development-certification/basic-javascript.json b/challenges/01-front-end-development-certification/basic-javascript.json index c45695e0eb..a5616d8def 100644 --- a/challenges/01-front-end-development-certification/basic-javascript.json +++ b/challenges/01-front-end-development-certification/basic-javascript.json @@ -4208,51 +4208,6 @@ "type": "waypoint", "challengeType": "1" }, - { - "id": "56533eb9ac21ba0edf2244e2", - "title": "Caesar's Cipher", - "description": [ - "One of the simplest and most widely known ciphers is a Caesar cipher, also known as a shift cipher. In a shift cipher the meanings of the letters are shifted by some set amount.", - "A common modern use is the ROT13 cipher, where the values of the letters are shifted by 13 places. Thus 'A' ↔ 'N', 'B' ↔ 'O' and so on.", - "Write a function which takes a ROT13 encoded string as input and returns a decoded string. All letters will be uppercase. Do not transform any non-alphabetic character (i.e. spaces, punctuation), but do pass them on.", - "The provided code transforms the input into an array for you, codeArr. Place the decoded values into the decodedArr array where the provided code will transform it back into a string." - ], - "releasedOn": "January 1, 2016", - "challengeSeed": [ - "function rot13(encodedStr) {", - " var codeArr = encodedStr.split(\"\"); // String to Array", - " var decodedArr = []; // Your Result goes here", - " // Only change code below this line", - " ", - " ", - " ", - " // Only change code above this line", - " return decodedArr.join(\"\"); // Array to String", - "}", - "", - "// Change the inputs below to test", - "rot13(\"SERR PBQR PNZC\");" - ], - "tail": [ - "" - ], - "solutions": [ - "var lookup = {\n 'A': 'N','B': 'O','C': 'P','D': 'Q',\n 'E': 'R','F': 'S','G': 'T','H': 'U',\n 'I': 'V','J': 'W','K': 'X','L': 'Y',\n 'M': 'Z','N': 'A','O': 'B','P': 'C',\n 'Q': 'D','R': 'E','S': 'F','T': 'G',\n 'U': 'H','V': 'I','W': 'J','X': 'K',\n 'Y': 'L','Z': 'M' \n};\n\nfunction rot13(encodedStr) {\n var codeArr = encodedStr.split(\"\"); // String to Array\n var decodedArr = []; // Your Result goes here\n // Only change code below this line\n \n decodedArr = codeArr.map(function(letter) {\n if(lookup.hasOwnProperty(letter)) {\n letter = lookup[letter];\n }\n return letter;\n });\n\n // Only change code above this line\n return decodedArr.join(\"\"); // Array to String\n}" - ], - "tests": [ - "assert(rot13(\"SERR PBQR PNZC\") === \"FREE CODE CAMP\", 'message: rot13(\"SERR PBQR PNZC\") should decode to \"FREE CODE CAMP\"');", - "assert(rot13(\"SERR CVMMN!\") === \"FREE PIZZA!\", 'message: rot13(\"SERR CVMMN!\") should decode to \"FREE PIZZA!\"');", - "assert(rot13(\"SERR YBIR?\") === \"FREE LOVE?\", 'message: rot13(\"SERR YBIR?\") should decode to \"FREE LOVE?\"');", - "assert(rot13(\"GUR DHVPX OEBJA QBT WHZCRQ BIRE GUR YNML SBK.\") === \"THE QUICK BROWN DOG JUMPED OVER THE LAZY FOX.\", 'message: rot13(\"GUR DHVPX OEBJA QBT WHZCRQ BIRE GUR YNML SBK.\") should decode to \"THE QUICK BROWN DOG JUMPED OVER THE LAZY FOX.\"');" - ], - "type": "waypoint", - "challengeType": "1", - "nameCn": "", - "nameFr": "", - "nameRu": "", - "nameEs": "", - "namePt": "" - }, { "id": "cf1111c1c11feddfaeb9bdef", "title": "Generate Random Fractions with JavaScript",