Last active
December 24, 2015 14:19
Revisions
-
sydlawrence revised this gist
Oct 3, 2013 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -19,11 +19,11 @@ runCode(); // wait for the previous tests to run and succeed, then paste the next runCode(); editor.setValue("function longestString(i) { var l = ''; for (var j in i) if (i[j].length > l.length && typeof i[j] === 'string') l = i[j]; return l; }"); runCode(); // wait for the previous tests to run and succeed, then paste the next runCode(); editor.setValue("function arraySum(i) { var s = 0; for (var j in i) { if (typeof i[j] === 'number') s += i[j]; if (typeof i[j] === 'object') s += arraySum(i[j]); } return s; }"); runCode(); -
sydlawrence created this gist
Oct 3, 2013 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,29 @@ // Paste these in chunks into the developer console. BEFORE you press "Start game" startGame(); editor.setValue("function doubleInteger(i) { return i*2; }"); runCode(); // wait for the previous tests to run and succeed, then paste the next runCode(); editor.setValue("function isNumberEven(i) { return !(i%2); }"); runCode(); // wait for the previous tests to run and succeed, then paste the next runCode(); editor.setValue("function getFileExtension(i) { var s = i.split('.'); return (s.length > 1) ? s[1] : false; }"); runCode(); // wait for the previous tests to run and succeed, then paste the next runCode(); editor.setValue("function longestString(i) { var l = ''; for (var j = 0; j < i.length; j++) if (i[j].length > l.length && typeof i[j] === 'string') l = i[j]; return l; }"); runCode(); // wait for the previous tests to run and succeed, then paste the next runCode(); editor.setValue("function arraySum(i) { var s = 0; for (var j = 0; j < i.length; j++) { if (typeof i[j] === 'number') s += i[j]; if (typeof i[j] === 'object') s += arraySum(i[j]); } return s; }"); runCode();