From 8225ce3cdbc1b083ccee5404fd9c77234d226031 Mon Sep 17 00:00:00 2001 From: benmcmahon100 Date: Sat, 1 Aug 2015 16:10:21 +0100 Subject: [PATCH 1/2] All done without the extra regex --- challenges/basic-javascript.json | 150 ++++++++++++++++++------------- 1 file changed, 88 insertions(+), 62 deletions(-) diff --git a/challenges/basic-javascript.json b/challenges/basic-javascript.json index cd6d3b60d0..dabf28c174 100644 --- a/challenges/basic-javascript.json +++ b/challenges/basic-javascript.json @@ -1042,7 +1042,7 @@ "id":"cf1111c1c12feddfaeb8bdef", "name":"Finding WhiteSpace", "dashedName":"waypoint-finding-whitespace", - "difficulty":"9.987", + "difficulty":"9.986", "description":[ "", "We can also use selectors like \\s to find spaces in a string", @@ -1073,7 +1073,7 @@ "id":"cf1111c1c12feddfaeb9bdef", "name":"Creating a slots machine", "dashedName":"creating-a-slots-machine", - "difficulty":"9.987", + "difficulty":"9.988", "description":[ "", "We are now going to try and combine some of the stuff we've just learnt abd create the logic for a slot machine game", @@ -1086,7 +1086,7 @@ "assert(typeof(runSlots($('.slot'))[0]) == 'number', 'SlotOne should be a random number');", "assert(typeof(runSlots($('.slot'))[1]) == 'number', 'SlotTwo should be a random number');", "assert(typeof(runSlots($('.slot'))[2]) == 'number', 'SlotThree should be a random number');", - "assert(editorValue.match(/Math.floor\\(Math.random\\(\\) \\* \\(5 \\- 1 \\+ 1\\)\\) \\+ 1/g).length === 3);" + "assert((function(){if(editor.match(/Math.floor\\(Math\\.random\\(\\)\\s\\*\\s\\(5\\s\\-\\s1\\s\\+\\s1\\)\\)\\s\\+\\s1;/gi) !== null){return(editor.match(/Math.floor\\(Math\\.random\\(\\)\\s\\*\\s\\(5\\s\\-\\s1\\s\\+\\s1\\)\\)\\s\\+\\s1;/gi).length >= 3);}else{return(false);}})(), 'You should have used Math.floor(Math.random() * (5 - 1 + 1)) + 1; three times to generate your random numbers');" ], "challengeSeed":[ "fccss", @@ -1103,6 +1103,9 @@ " ", " /*Don't modify below here*/", " ", + " $('.logger').html('');", + " $('.logger').html('Not A Win')", + " ", " if(slotOne !== undefined && slotTwo !== undefined && slotThree !== undefined){", " $('.logger').html(slotOne + ' ' + slotTwo + ' ' + slotThree);", " }", @@ -1119,6 +1122,7 @@ "
", "
", "
", + " ", "

FCC Slot Machine

", "
", "
", @@ -1145,54 +1149,59 @@ "
", "
", "", - "", - "", "