Merge branch 'staging' of github.com:FreeCodeCamp/freecodecamp into staging

Conflicts:
	seed/challenges/basic-javascript.json
This commit is contained in:
Quincy Larson
2015-07-28 23:11:00 -07:00
2 changed files with 363 additions and 183 deletions

View File

@ -1,6 +1,6 @@
{
"name": "Basic JavaScript",
"order": 0.005,
"order": 0.006,
"challenges": [
{
"id":"bd7123c9c441eddfaeb4bdef",
@ -265,7 +265,7 @@
"challengeType": 1
},
{
"id": "bd1111c1c11feddfaeb3bdef",
"id": "cf1111c1c11feddfaeb3bdef",
"name": "Magical Maths Addition",
"dashedName": "waypoint-magical-maths-addition",
"difficulty": "9.98141",
@ -289,7 +289,7 @@
"challengeType": 1
},
{
"id": "bd1111c1c11feddfaeb4bdef",
"id": "cf1111c1c11feddfaeb4bdef",
"name": "Magical Maths Subtraction",
"dashedName": "waypoint-magical-maths-subtraction",
"difficulty": "9.98142",
@ -313,7 +313,7 @@
"challengeType": 1
},
{
"id": "bd1111c1c11feddfaeb5bdef",
"id": "cf1231c1c11feddfaeb5bdef",
"name": "Magical Maths Multiplication",
"dashedName": "waypoint-magical-maths-multiplication",
"difficulty": "9.98143",
@ -337,7 +337,7 @@
"challengeType": 1
},
{
"id": "bd1111c1c11feddfaeb6bdef",
"id": "cf1111c1c11feddfaeb6bdef",
"name": "Magical Maths Division",
"dashedName": "waypoint-magical-maths-division",
"difficulty": "9.9814",
@ -361,7 +361,7 @@
"challengeType": 1
},
{
"id": "bd1111c1c11feddfaeb4bdee",
"id": "cf1391c1c11feddfaeb4bdef",
"name": "Creating Decimals",
"dashedName": "waypoint-creating-decimals",
"difficulty": "9.9815",
@ -439,7 +439,7 @@
"challengeType": 1
},
{
"id": "bd1111c1c11feddfaeb7bdef",
"id":"cf1111c1c11feddfaeb7bdef",
"name":"Nesting Arrays",
"dashedName":"waypoint-nesting-arrays",
"difficulty":"9.98161",
@ -470,8 +470,9 @@
"Indexes are written in the same way as bracket notation that we covered earlier",
"Example:",
"<code>",
"var array = [1,2,3]",
"array[0]//equals 1",
"var array = [1,2,3];",
"array[0];//equals 1",
"var data = array[1];",
"</code>",
"Create a var called <code>data</code> and set it to equal the first value of <code>myArray</code>"
],
@ -490,6 +491,39 @@
],
"challengeType": 1
},
{
"id":"cf1111c1c11feddfaeb8bdef",
"name":"Modifying Data With Indexes",
"dashedName":"waypoint-modifying-data-with-indexes",
"difficulty":"9.98171",
"description":[
"",
"We are able to modify the data store in an array be using indexes",
"Example:",
"<code>",
"var ourArray = [1,2,3];",
"ourArray[0] = 3;//ourArray equals [3,2,3]",
"</code>",
"Now Let's modify <code>myArray</code> using an index",
""
],
"tests":[
"assert((function(){if(typeof(myArray) != 'undefined' && myArray[0] == 3 && myArray[1] == 2 && myArray[2] == 3){return(true);}else{return(false);}})(), 'myArray should now be [3,2,3]');",
"assert((function(){if(editor.getValue().match(/[0]/g).length >= 2 && editor.getValue().match(/=/g).length >= 2){return(true);}else{return(false);}})(), 'You should be using indexes to modify the values in myArray');"
],
"challengeSeed":[
"//var ourArray = [1,2,3];",
"//ourArray[0] = 3;",
"",
"var myArray = [1,2,3];",
"",
"",
"",
"",
"if(typeof(myArray) != 'undefined'){(function(){return(myArray);})();}"
],
"challengeType": 1
},
{
"id": "bg9994c9c69feddfaeb9bdef",
"name": "Manipulating Arrays With pop()",
@ -602,123 +636,31 @@
"In JavaScript we can divide up our code into separate and reusable parts called functions",
"here's and example of a function",
"<code>",
"function funcitonName (one, two ,three){",
" /*Some Code*/",
"function functionName (a, b){",
" return(a + b);",
"}",
"</code>",
"our function can be called like this",
"<code>functionName();</code>",
"Let's try creating and calling a function now."
"Let's try creating and calling a function now called <code>myFunction</code>"
],
"tests":[
"assert(f==data);"
"assert((function(){if(typeof(f) !== 'undefined' && typeof(f) === 'number' && f === 9){return(true);}else{return(false);}})(), 'Your function should return the value of a + b');"
],
"challengeSeed":[
"//var ourData = 'function called!';",
"//function ourFunction(ourData) {/*ourData is being passed to this function as an argument*/",
"//return(data);",
"//}",
"",
"var data = 'Function Called!';",
"",
"//Create a function called myFunction that takes data as an argument and returns it like the example above",
"",
"var a = 4;",
"var b = 5;",
"//Don not modify the above!",
"//Create a function called myFunction that adds a and b",
"",
"",
"",
"",
"//Don't modify this!",
"var f=myFunction(data);",
"(function(){var f=myFunction(data);return(f);})('');"
],
"challengeType": 1
},
{
"id": "bg9997c9c99feddfaeb9bdef",
"name": "Doing things inside functions",
"dashedName": "waypoint-doing-things-inside-functions",
"difficulty": "9.982",
"description": [
"",
"A function that takes the value you give it and returns it isn't very useful! So now let's get our functions to do something!",
"Starting from where we were last time let's make our function revers whatever we give it by chaining <code> .split('') </code>, <code> .reverse() </code> and <code> .join('') </code>"
],
"tests": [
"assert(f==data.split('').reverse().join(''), 'myFunction should now return the reversed version of data (!dellaC noitcnuF)');"
],
"challengeSeed": [
"//You can reverse strings like this",
"//var notReversed = 'String';",
"//var reversed = notReversed.split('').reverse().join('');",
"",
"var data = 'Function Called!';",
"",
"function myFunction(data){",
" ",
" return(data);",
"}",
"",
"",
"",
"//Don't modify this!",
"var f=myFunction(data);",
"(function(f){return(f);})(f);"
],
"challengeType": 1
},
{
"id": "bg9997c9c99feddfaeb9bdee",
"name": "Keeping In The Scope Of Things",
"dashedName": "waypoint-keeping-in-the-scope-of-things",
"difficulty": "9.9821",
"description": [
"",
"All variables are contained in something called a <code> scope </code>.",
"A Scope defines where are variable can be accessed.",
"All variables created outside any functions exist in what is called the <code> global scope </code>",
"All variables are container or are scope to inside that function.",
"<code>",
"var variable = 'Global Scope'",
"function test(){",
" return(variable);",
"}",
"test();//Returns Global Scope",
"",
"function change(){",
" variable = 'test';",
" return(variable);",
"}",
"",
"change();//Returns test",
"variable //equals Global Scope",
"",
"</code>",
"Let's give this a go!"
],
"tests": [
"assert(Global == access(Global), 'access should return your Global var');",
"assert(Global != localChange(Global), 'localChange should return your Global var');"
],
"challengeSeed": [
"//Create Your global variable with any value here",
"var Global = _;",
"",
"//Make access() return you global variable",
"function access(){",
" ",
"}",
"",
"access();",
"",
"//Pass you global variable into localChange and modify it within the function",
"function localChange(){",
" ",
"}",
"",
"//Don't forget to call localChange here and pass your global variable",
"",
"",
"(function(x,y,z){return('access returns: ' + y(x) + ' & localChange returns: ' + z(x));})(Global, access, localChange);"
"if(typeof(myFunction) != 'undefined'){",
"var f=myFunction(a,b);",
"(function(){return(f);})();",
"}"
],
"challengeType": 1
},
@ -816,7 +758,7 @@
"challengeType": 1
},
{
"id": "bd1111c1c11feddfaeb5bdee",
"id":"cf1111c1c11feddfaeb5bdef",
"name":"Looping with for",
"dashedName":"waypoint-looping-with-for",
"difficulty":"9.9824",
@ -846,7 +788,7 @@
"challengeType": 1
},
{
"id": "bd1111c1c11feddfaeb1bdef",
"id":"cf1111c1c11feddfaeb1bdef",
"name":"Looping with while",
"dashedName":"waypoint-looping-with-while",
"difficulty":"9.9825",
@ -877,7 +819,7 @@
"challengeType": 1
},
{
"id": "bd1111c1c11feddfaeb2bdef",
"id":"cf1111c1c11feddfaeb2bdef",
"name":"Looping with do while",
"dashedName":"waypoint-looping-with-do-while",
"difficulty":"9.9826",
@ -906,6 +848,227 @@
""
],
"challengeType": 1
},
{
"id":"cf1111c1c11feddfaeb9bdef",
"name":"Random Numbers",
"dashedName":"waypoint-random-numbers",
"difficulty":"9.9827",
"description":[
"",
"Random numbers are a very useful for creating random behaviours and games",
"Javascript has a <code>Math.random()</code> method that can generate a random decimal number",
"Let's have a go of <code>Math.random()</code> now be getting <code>myFunction</code> to return a random number"
],
"tests":[
"assert(typeof(myFunction()) === 'number', 'myFunction should return a random number');",
"assert((myFunction()+''). match(/\\./g), 'The number returned by myFunction should be a decimal');",
"assert(editor.getValue().match(/Math\\.random/g).length >= 2, 'You should be using Math.random to generate the random decimal number');"
],
"challengeSeed":[
"",
"function myFunction(){",
" //Change the 0 to Math.random()",
" return(0);",
"}",
"",
"(function(){return(myFunction());})();"
],
"challengeType": 1
},
{
"id":"cf1111c1c12feddfaeb1bdef",
"name":"Random Whole Numbers",
"dashedName":"waypoint-random-whole-numbers",
"difficulty":"9.9828",
"description":[
"",
"While it's great that we can create random decimal numbers it's a lot more useful to generate a random whole number",
"To achieve this we can multiply the random number by ten and use the <code>Math.floor()</code> to convert the decimal number to a whole number",
"This technique gives us a whole number between zero and nine",
"Example:",
"<code>Math.floor(Math.random()*10);</code>",
"Let's give this technique a go now"
],
"tests":[
"assert(typeof(myFunction()) == 'number', 'The result of myFunction should be a number');",
"assert(editor.getValue().match(/Math.random/g), 'You should be using Math.random to create a random number');",
"assert(!(''+myFunction()).match(/\\./g), 'You should have multiplied the result of Math.random but 10 to make it a number that\\'s greater then zero');",
"assert(editor.getValue().match(/Math.floor/g), 'You should use Math.floor to remove the decimal part of the number');"
],
"challengeSeed":[
"function myFunction(){",
" //Make myFunction return a random number between zero and nine instead of a float",
" return(Math.random());",
"}",
"",
"(function(){return(myFunction());})();"
],
"challengeType": 1
},
{
"id":"cf1111c1c12feddfaeb2bdef",
"name":"Random Whole Numbers In a Range",
"dashedName":"waypoint-random-whole-numbers-in-a-range",
"difficulty":"9.9829",
"description":[
"",
"We can use a certain mathematical expression to get a random number between between twp numbers.",
"<code>Math.floor(Math.random() * (max - min + 1)) + min</code>",
"By using this we can control the output of the random number.",
""
],
"tests":[
"assert(myFunction() >= min, 'The random number that\\'s generated by myFunction should be greater than or equal to the minimum number');",
"assert(myFunction() <= max, 'The random number that\\'s generated by myFunction should be less than or equal to the maximum number');",
"assert((function(){if(editor.getValue().match(/max/g).length >= 2 && editor.getValue().match(/min/g).length >= 3 && editor.getValue().match(/Math.floor/g) && editor.getValue().match(/Math.random/g)){return(true);}else{return(false);}})(), 'You should be using the function given in the description to calculate the random in number in a range');"
],
"challengeSeed":[
" var min = 0;",
" var max = 12;",
"function myFunction(){",
" //Make myFunction return a random number between zero and nine instead of a float",
" return(Math.random());",
"}",
"",
"(function(){return(myFunction());})();"
],
"challengeType": 1
},
{
"id":"cf1111c1c12feddfaeb3bdef",
"name":"If Else Statements",
"dashedName":"waypoint-if-else-statements",
"difficulty":"9.983",
"description":[
"",
"We can use if statements in JavaScript to only execute code if a certain condition is met",
"if statements require some sort of boolean condition evaluate",
"Example:",
"<code>if(1==2){",
" return(true);",
"}",
"else{",
" return(false);",
"}</code>",
"Let's have a go of using if statements now by making a coin-flip game",
"Create an if else statement to return <code>heads</code> if the flip var is zero and to return <code>tails</code> if it's not"
],
"tests":[
"assert((function(){if(myFunction() == 'heads' || myFunction() == 'tails'){return(true);}else{return(false);}})(), 'myFunction should either return heads or tails');",
"assert(editor.getValue().match(/if/g).length >= 3, 'You should have created a new if statement');",
"assert(editor.getValue().match(/else/g).length >= 2, 'You should have created a new else statement');"
],
"challengeSeed":[
"function myFunction(){",
" var flip = Math.floor(Math.random() * (1 - 0 + 1)) + 0;",
" //Create and if else statement here to return heads if flip is 0 otherwise return false",
" ",
"}",
"",
"(function(){return(myFunction());})();"
],
"challengeType": 1
},
{
"id":"cf1111c1c12feddfaeb6bdef",
"name":"An Intro To RegEx",
"dashedName":"waypoint-an-intro-to-regex",
"difficulty":"9.984",
"description":[
"",
"RegEx is a powerful tool we can use to find certain words or patterns in strings",
"RegEx can look difficult at first but there's not much to getting it working",
"If we wanted to find the number of times the word \"the\" occured in the string \"The dog chased the cat\" We could use the following RegEx:",
"<code>\/the+\/gi</code>",
"Let's break this down a bit",
"\"The\" is the pattern we want to match",
"\"+\" means we are looking for one or more occurrences of this pattern",
"\"g\" means that it searhces the whole string",
"\"i\" means that we are ignoring the case(upper or lower) of what we are looking for",
"Let's try finding the word and in the string \"John and Alan went to the shop and got some milk\" by replacing the <code>.+</code> in the currnet RegEx with something that will find the word \"and\" and count how many times it occurs"
],
"tests":[
"assert(test==2, 'You\\'re RegEx should have found two occurances of the word \"and\"');",
"assert(editor.getValue().match(/\\/and\\+\\/gi/), 'You should have used this RegEx to find the word \"and\"');"
],
"challengeSeed":[
"var test = (function(){",
" var testString = \"John and Alan went to the shop and got some milk\";",
"",
"//Do Not Modify Above",
"",
" var expression = /.+/gi;",
"",
"//Do Not Modify Below",
"",
" return(testString.match(expression).length);",
"})();(function(){return(test);})();"
],
"challengeType": 1
},
{
"id":"cf1111c1c12feddfaeb7bdef",
"name":"Finding Numbers",
"dashedName":"waypoint-finding-numbers",
"difficulty":"9.985",
"description":[
"",
"We can use special selectors in RegEx to select a particular type of value",
"One such selector is the digit selector <code>\\d</code> which is used to grab the numbers in a string",
"It is used like this:",
"<code>/\\d+/g</code>",
""
],
"tests":[
"assert(test === 2, 'Your RegEx should have found two numbers in the testString');",
"assert(editor.getValue().match(/\\/\\\\d\\+\\//gi), 'You should be using the following expression /\\d+/gi to find the numbers in the testString');"
],
"challengeSeed":[
"var test = (function(){",
" var testString = \"There's 3 cats but 4 dogs.\"",
"",
"//Do Not Modify Above",
"",
" var expression = /.+/gi;",
"",
"//Do Not Modify Below",
"",
" return(testString.match(expression).length);",
"})();(function(){return(test);})();"
],
"challengeType": 1
},
{
"id":"cf1111c1c12feddfaeb8bdef",
"name":"Finding WhiteSpace",
"dashedName":"waypoint-finding-whitespace",
"difficulty":"9.987",
"description":[
"",
"We can also use selectors like <code>\\s</code> to find spaces in a string",
"It is used like this:",
"<code>/\\s+/g</code>",
""
],
"tests":[
"assert(test === 7, 'Your RegEx should have found seven spaces in the testString');",
"assert(editor.getValue().match(/\\/\\\\s\\+\\//gi), 'You should be using the following expression /\\s+/gi to find the spaces in the testString');"
],
"challengeSeed":[
"var test = (function(){",
" var testString = \"How many spaces are there in this sentance.\";",
"",
"//Do Not Modify Above",
"",
" var expression = /.+/gi;",
"",
"//Do Not Modify Below",
"",
" return(testString.match(expression).length);",
"})();(function(){return(test);})();"
],
"challengeType": 1
}
]
}

View File

@ -1,30 +1,47 @@
[
{
"id": "bd7167d8c441cbafaeb5bdef",
"email": "Ada_Gerlach@gmail.com",
"phone": "1-140-557-0727",
"company": "Livestream",
"country": "Singapore",
"city": "Morar berg",
"state": "South Dakota",
"position": "Junior Backend Developer (Node.js)",
"logoUrl": "https://s3.amazonaws.com/prod-heroku/greenhouse_job_boards/logos/000/001/189/resized/livestream_logo-rgb_standard-cc718e67ce1a0f6fa400f609bdefe605.png?1429547161",
"postingUrl": "https://boards.greenhouse.io/livestream/jobs/59458?t=ek25h0#.VWeTk1xVhBc?source=freecodecamp.com"
"logo": "https://s3.amazonaws.com/prod-heroku/greenhouse_job_boards/logos/000/001/189/resized/livestream_logo-rgb_standard-cc718e67ce1a0f6fa400f609bdefe605.png?1429547161",
"description": "Live life one inhalation and one exhalation at a time. May you be healthy. Let the muscles in your neck and shoulders relax. May you be safe. Reflect on the fragility and preciousness of life. Empty your mind; be formless, shapeless like water. May you be at peace. Take a deep breath. You can do what you set out to do; yes, you can. You can do what you set out to do; yes, you can. Watch each breath appear and disappear, just breathing. Give yourself a break. Live life one inhalation and one exhalation at a time. Give yourself a break. Just acknowledge what's there and let be. You can get through this. Open your heart to change, forgiveness and lovingkindness. Love is the first seed of the soul. It will be ok. Impermanence and change is a powerful teacher and teaching. Bring love into your heart, into your breath and into your being. Briefly notice any emotions, thoughts or sensations that may be driving fear and anxiety and let them be. This discomfort will pass. Bring love into your heart, into your breath and into your being. Take a deep breath. Reflect on the fragility and preciousness of life."
},
{
"id": "bd7167d8c442cbafaeb5bdef",
"email": "Ada_Gerlach@gmail.com",
"company": "Adobe",
"country": "Singapore",
"city": "Morar berg",
"state": "South Dakota",
"position": "Junior JavaScript Engineer",
"logoUrl": "http://cdn-3.famouslogos.us/images/adobe-logo.jpg",
"postingUrl": "https://adobe.taleo.net/careersection/2/jobdetail.ftl?job=32619&lang=en"
"logo": "http://cdn-3.famouslogos.us/images/adobe-logo.jpg",
"description": "Live life one inhalation and one exhalation at a time. May you be healthy. Let the muscles in your neck and shoulders relax. May you be safe. Reflect on the fragility and preciousness of life. Empty your mind; be formless, shapeless like water. May you be at peace. Take a deep breath. You can do what you set out to do; yes, you can. You can do what you set out to do; yes, you can. Watch each breath appear and disappear, just breathing. Give yourself a break. Live life one inhalation and one exhalation at a time. Give yourself a break. Just acknowledge what's there and let be. You can get through this. Open your heart to change, forgiveness and lovingkindness. Love is the first seed of the soul. It will be ok. Impermanence and change is a powerful teacher and teaching. Bring love into your heart, into your breath and into your being. Briefly notice any emotions, thoughts or sensations that may be driving fear and anxiety and let them be. This discomfort will pass. Bring love into your heart, into your breath and into your being. Take a deep breath. Reflect on the fragility and preciousness of life."
},
{
"id": "bd7167d8c443cbafaeb5bdef",
"phone": "1-140-557-0727",
"company": "Bookspan",
"country": "Singapore",
"city": "Morar berg",
"state": "South Dakota",
"position": "Full Stack JavaScript Developer (Junior)",
"logoUrl": "https://tm-prod.global.ssl.fastly.net/uploaded/companies/227/small_logo.png?v=db9dbe",
"postingUrl": "http://bookspan.theresumator.com/apply/10190b666b74087b537f4659756f7c5679000704722064232c1d2e3b2b102501310437/Fullstack-Javascript-Developer-junior?source=freecodecamp.com&sid=zvi9YD9OcHwoDZNgM3XI9uPszGvqxJo6eHf"
"logo": "https://tm-prod.global.ssl.fastly.net/uploaded/companies/227/small_logo.png?v=db9dbe",
"description": "Live life one inhalation and one exhalation at a time. May you be healthy. Let the muscles in your neck and shoulders relax. May you be safe. Reflect on the fragility and preciousness of life. Empty your mind; be formless, shapeless like water. May you be at peace. Take a deep breath. You can do what you set out to do; yes, you can. You can do what you set out to do; yes, you can. Watch each breath appear and disappear, just breathing. Give yourself a break. Live life one inhalation and one exhalation at a time. Give yourself a break. Just acknowledge what's there and let be. You can get through this. Open your heart to change, forgiveness and lovingkindness. Love is the first seed of the soul. It will be ok. Impermanence and change is a powerful teacher and teaching. Bring love into your heart, into your breath and into your being. Briefly notice any emotions, thoughts or sensations that may be driving fear and anxiety and let them be. This discomfort will pass. Bring love into your heart, into your breath and into your being. Take a deep breath. Reflect on the fragility and preciousness of life."
},
{
"id": "bd7167d8c444cbafaeb5bdef",
"email": "Ada_Gerlach@gmail.com",
"company": "Good Eggs",
"country": "Singapore",
"city": "Morar berg",
"state": "South Dakota",
"position": "Full Stack Developer",
"logoUrl": "https://d1qb2nb5cznatu.cloudfront.net/startups/i/72165-64efbd521cdfe3357c811758f5436e7d-medium_jpg.jpg",
"postingUrl": "http://www.jobscore.com/jobs2/goodeggs/full-stack-developer/cQ_hd-0USr4Om7eJe4iefn?Board=freecodecamp.com"
"logo": "https://d1qb2nb5cznatu.cloudfront.net/startups/i/72165-64efbd521cdfe3357c811758f5436e7d-medium_jpg.jpg",
"description": "Live life one inhalation and one exhalation at a time. May you be healthy. Let the muscles in your neck and shoulders relax. May you be safe. Reflect on the fragility and preciousness of life. Empty your mind; be formless, shapeless like water. May you be at peace. Take a deep breath. You can do what you set out to do; yes, you can. You can do what you set out to do; yes, you can. Watch each breath appear and disappear, just breathing. Give yourself a break. Live life one inhalation and one exhalation at a time. Give yourself a break. Just acknowledge what's there and let be. You can get through this. Open your heart to change, forgiveness and lovingkindness. Love is the first seed of the soul. It will be ok. Impermanence and change is a powerful teacher and teaching. Bring love into your heart, into your breath and into your being. Briefly notice any emotions, thoughts or sensations that may be driving fear and anxiety and let them be. This discomfort will pass. Bring love into your heart, into your breath and into your being. Take a deep breath. Reflect on the fragility and preciousness of life."
}
]