Conflicts:
	views/partials/navbar.jade
This commit is contained in:
Michael Q Larson
2015-03-05 10:56:06 -08:00
3 changed files with 15 additions and 6 deletions

View File

@ -31,6 +31,9 @@ exports.returnNextChallenge = function(req, res) {
exports.returnChallenge = function(req, res) {
var challengeNumber = parseInt(req.params.challengeNumber) || 0;
if (challengeNumber === 2) {
return res.redirect('../challenges/3');
}
if (challengeNumber > highestChallengeNumber) {
req.flash('errors', {
msg: "It looks like you've either completed all the challenges we have available or requested a challenge we don't have."

View File

@ -198,13 +198,18 @@
"name": "Mutations",
"difficulty": "1.12",
"description": [
"Return true if the string in the first element of the array contains the string in the second element in any form."
"Return true if the string in the first element of the array contains the letters of the string in the second element of the array.",
"For example, ['hello', 'Hello'], should return true because all of the letters in the second string are present in the first, ignoring case.",
"The arguments ['hello', 'hey'] should return false because the string 'hello' does not contain a 'y'.",
"Another example, ['Alien', 'line'], should return true because all of the letters in 'line' are present in 'Alien'."
],
"challengeSeed": "function mutation(arr) {\n return arr;\n}\n\nmutation(['hello', 'hey']);",
"tests": [
"expect(mutation(['hello', 'hey'])).to.be.false;",
"expect(mutation(['hello', 'Hello'])).to.be.true;",
"expect(mutation(['zyxwvutsrqponmlkjihgfedcba', 'qrstu'])).to.be.true;"
"expect(mutation(['zyxwvutsrqponmlkjihgfedcba', 'qrstu'])).to.be.true;",
"expect(mutation(['Mary', 'Army'])).to.be.true;",
"expect(mutation(['Alien', 'line'])).to.be.true;"
]
},
{
@ -564,11 +569,12 @@
"difficulty": "3.50",
"description": [
"Return a new array that transforms the element's average altitude into their orbital periods.",
"The array will contain objects in the format {name: 'name', avgAlt: avgAlt}.",
"The array will contain objects in the format <code>{name: 'name', avgAlt: avgAlt}</code>.",
"You can read about orbital periods <a href=\"http://en.wikipedia.org/wiki/Orbital_period\">on wikipedia</a>.",
"The values should be rounded to the nearest whole number. Assume the body being orbited is Earth."
"The values should be rounded to the nearest whole number. The body being orbited is Earth.",
"The radius of the earth is 6367.4447 kilometers, and the GM value of earth is 398600.4418"
],
"challengeSeed": "function orbitalPeriod(arr) {\n\/\/Use 398600.4418 for GM. Look up any other values on wolfram alpha\n return arr;\r\n}\r\n\r\norbitalPeriod([{name : \"sputkin\", avgAlt : 35873.5553}]);",
"challengeSeed": "function orbitalPeriod(arr) {\n var GM = 398600.4418;\n var earthRadius = 6367.4447;\n return arr;\r\n}\r\n\r\norbitalPeriod([{name : \"sputkin\", avgAlt : 35873.5553}]);",
"tests": [
"expect(orbitalPeriod([{name : \"sputkin\", avgAlt : 35873.5553}])).to.eqls([{name: \"sputkin\", orbitalPeriod: 86400}]);",
"expect(orbitalPeriod([{name: \"iss\", avgAlt: 413.6}, {name: \"hubble\", avgAlt: 556.7}, {name: \"moon\", avgAlt: 378632.553}])).to.eqls([{name : \"iss\", orbitalPeriod: 5557}, {name: \"hubble\", orbitalPeriod: 5734}, {name: \"moon\", orbitalPeriod: 2377399}]);"

View File

@ -35,7 +35,7 @@
]
},
{
"name": "Join Our Forum",
"name": "Join Our Forum (currently disabled)",
"time": 5,
"video": "115275066",
"challengeNumber": 2,