Skip to content

Instantly share code, notes, and snippets.

@egocks
Created September 15, 2012 13:47
Show Gist options
  • Save egocks/3727985 to your computer and use it in GitHub Desktop.
Save egocks/3727985 to your computer and use it in GitHub Desktop.
Elevator Control Function
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
Copy link
Author

egocks commented Sep 15, 2012

Elevator version 1 features:

  1. Elevator can move to and from any floor between 'B' (basement) and floor 100. Floor 'B' is the lowest floor next to the 1st floor. Floor 'G' (ground) is equivalent to the 1st floor.
  2. Maximum weight is 2500. If input weight is greater than the maximum, Elevator will not travel, and will signal "Overload".
  3. For version 1, elevator always resets to 1st floor after each completed operation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment