Skip to content

Instantly share code, notes, and snippets.

@SeanPlusPlus
Created January 28, 2015 22:53
Show Gist options
  • Save SeanPlusPlus/3064f570df971af9b79d to your computer and use it in GitHub Desktop.
Save SeanPlusPlus/3064f570df971af9b79d to your computer and use it in GitHub Desktop.
Elevator Saga Challenge 1
// http://play.elevatorsaga.com/#challenge=1
{
init: function(elevators, floors) {
var elevator = elevators[0]; // Let's use the first elevator
elevator.on("idle", function() {
// The elevator is idle, so let's go to all the floors (or did we forget one?)
elevator.goToFloor(0);
elevator.goToFloor(1);
elevator.goToFloor(2);
});
},
update: function(dt, elevators, floors) {
// We normally don't need to do anything here
}
}
@gsharp
Copy link

gsharp commented Feb 3, 2015

this got you to exercise 4?

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