diff --git a/seed/challenges/basic-javascript.json b/seed/challenges/basic-javascript.json index fd12dfcf425..8a5ee04a795 100644 --- a/seed/challenges/basic-javascript.json +++ b/seed/challenges/basic-javascript.json @@ -121,7 +121,7 @@ "For example, if we created a variable var firstName = \"Julie\", we could find out how long the string \"Julie\" is by using the firstName.length property." ], "tests": [ - "(function(){if(typeof(lastNameLength) != 'undefined' && typeof(lastNameLength) == 'number' && lastNameLength == 4){return(true);}else}{return(false);}}, 'lastNameLength should be equal to four')()" + "(function(){if(typeof(lastNameLength) != 'undefined' && typeof(lastNameLength) == 'number' && lastNameLength == 4){return(true);}else{return(false);}})(), 'lastNameLength should be equal to four')()" ], "challengeSeed": [ "var firstName = \"Madeline\";", @@ -1096,6 +1096,8 @@ " var slotTwo;", " var slotThree;", " ", + " var images = ['http://bit.ly/fcc-kittens','http://bit.ly/fcc-kittens','http://bit.ly/fcc-kittens','http://bit.ly/fcc-kittens','http://bit.ly/fcc-kittens'];", + " ", " /*Don't modify above here*/", " ", " ", @@ -1145,75 +1147,224 @@ " ", " ", "", - "", - "", - "", - "" - ], + "", + "", + "", + "" + ], + "challengeType": 0 + }, + { + "id":"cf1111c1c13feddfaeb1bdef", + "name":"Setting Up The Slot Machine Slots", + "dashedName":"setting-up-the-slot-machine-slots", + "difficulty":"9.987", + "description":[ + "", + "Now that we have our random numbers we need to go and check for when they are all the same that means we should count it as a win", + "du" + ], + "tests":[ + "assert(typeof(runSlots($(''))[0]) == 'number', 'SlotOne should be a random number');", + "assert(typeof(runSlots($(''))[1]) == 'number', 'SlotTwo should be a random number');", + "assert(typeof(runSlots($(''))[2]) == 'number', 'SlotThree should be a random number');", + "assert(editor.getValue().match(/Math.floor\\(Math.random\\(\\) \\* \\(5 \\- 1 \\+ 1\\)\\) \\+ 1/g).length === 3);" + ], + "challengeSeed":[ + "fccss", + " function runSlots(slots){", + " var slotOne;", + " var slotTwo;", + " var slotThree;", + " ", + " var images = ['http://bit.ly/fcc-kittens','http://bit.ly/fcc-kittens','http://bit.ly/fcc-kittens','http://bit.ly/fcc-kittens','http://bit.ly/fcc-kittens'];", + " ", + " slotOne = Math.floor(Math.random() * (5 - 1 + 1)) + 1;", + " slotTwo = Math.floor(Math.random() * (5 - 1 + 1)) + 1;", + " slotThree = Math.floor(Math.random() * (5 - 1 + 1)) + 1;", + " ", + " /*Don't modify above here*/", + " ", + " ", + " ", + " /*Don't modify below here*/", + " ", + " if(slotOne !== undefined && slotTwo !== undefined && slotThree !== undefined){", + " $('.logger').html(slotOne + ' ' + slotTwo + ' ' + slotThree);", + " }", + " return([slotOne, slotTwo, slotThree]);", + " }", + "", + " $(document).ready(function(){", + " var slots = $('.slot');", + " ", + " $('.go').click(function(){", + " runSlots(slots);", + " });", + " });", + "fcces", + " ", + "
", + "
", + "
", + "

FCC Slot Machine

", + "
", + "
", + "
", + " ", + "
", + "
", + " ", + "
", + "
", + " ", + "
", + "
", + "
", + "
", + " ", + "
", + "
", + "
", + " ", + "
", + "
", + "
", + "", + "", + "", + "" + ], "challengeType": 0 } ]