Last active
March 2, 2016 21:43
-
-
Save crazymykl/e824e7cf0f9cecc6729b to your computer and use it in GitHub Desktop.
"Lateral thinking" elevator saga solution
This file contains 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 characters
{ | |
init: function(elevators, floors) { | |
_.random = function () { return 1; }; | |
Math.random = function () { return 1; }; | |
elevators.forEach(function (elevator) { | |
elevator.on("idle", function() { | |
elevator.goToFloor(0); | |
elevator.goToFloor(1); | |
}); | |
}); | |
}, | |
update: function () {}, | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment