Created
September 15, 2012 13:47
Revisions
-
egocks revised this gist
Sep 15, 2012 . 1 changed file with 1 addition and 28 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 @@ -1,28 +1 @@ var _0x2da0=["\x6C\x6F\x67","\x64\x6F\x6E\x65","\x74\x65\x78\x74","\x23\x73\x63\x6F\x72\x65","\x6F\x70\x65\x72\x61\x74\x65","\x42","\x47"];var score=0;var called=false;if(QUnit&&QUnit[_0x2da0[0]]){QUnit[_0x2da0[0]](function (){if(called===true){score++;called=false;} ;} );} ;if(QUnit&&QUnit[_0x2da0[1]]){QUnit[_0x2da0[1]](function (){$(_0x2da0[3])[_0x2da0[2]](score);} );} ;function Elevator(){this[_0x2da0[4]]=function (_0xb56ex4,_0xb56ex5){var _0xb56ex6=(_0xb56ex5==_0x2da0[5]||_0xb56ex5==_0x2da0[6]||_0xb56ex5<=1||_0xb56ex5>=100);var _0xb56ex7=(_0xb56ex4<=0||_0xb56ex4>=2500);var _0xb56ex8=(_0xb56ex4==null||isNaN(_0xb56ex4));var _0xb56ex9=(_0xb56ex5==null||(_0xb56ex5!==_0x2da0[5]&_0xb56ex5!==_0x2da0[6]&isNaN(_0xb56ex5)));called=_0xb56ex6||_0xb56ex7||_0xb56ex8||_0xb56ex9;} ;return this;} ; -
egocks revised this gist
Sep 15, 2012 . 1 changed file with 5 additions and 1 deletion.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 @@ -17,7 +17,11 @@ if(QUnit && QUnit.done) { function Elevator() { this.operate = function(weight,toFloor) { var toFloorChecked = (toFloor=='B' || toFloor=='G' || toFloor <=1 || toFloor >= 100); var weightChecked = (weight <= 0 || weight >= 2500); var isNaNWeightChecked = (weight == null || isNaN(weight)); var isNaNFloorChecked = (toFloor == null || ( toFloor !== 'B' & toFloor !== 'G' & isNaN(toFloor))); called = toFloorChecked || weightChecked || isNaNWeightChecked || isNaNFloorChecked; } return this; -
egocks revised this gist
Sep 15, 2012 . 1 changed file with 18 additions and 8 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 @@ -1,13 +1,23 @@ var score = 0; var called = false; if(QUnit && QUnit.log) { QUnit.log(function() { if(called===true) { score++; called=false; } }); } if(QUnit && QUnit.done) { QUnit.done(function() { $('#score').text(score); }); } function Elevator() { this.operate = function(weight,toFloor) { called = (toFloor=='B' || toFloor=='G' || toFloor <=1 || toFloor >= 100); } return this; -
egocks revised this gist
Sep 15, 2012 . 1 changed file with 7 additions and 1 deletion.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 @@ -1,7 +1,13 @@ function Elevator() { var maxFloor = 100; this.operate = function(weight,toFloor) { if(weight>2500) { throw 'Overload'; } if(weight<0) { throw 'Invalid'; } return true; } return this; -
egocks revised this gist
Sep 15, 2012 . 1 changed file with 2 additions and 1 deletion.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 @@ -1,5 +1,6 @@ function Elevator() { var maxFloor = 100; this.operate = function(weight,toFloor) { } -
egocks created this gist
Sep 15, 2012 .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,7 @@ function Elevator() { this.operate = function(weight,destination) { } return this; }