flâneur

Elevator Saga - the elevator programming game

play.elevatorsaga.com · 129 words · saved by 1 readers

Elevator Saga The elevator programming game Wiki & Solutions Documentation Help Challenge #1: Transport 15 people in 60 seconds or less Start 2x 0 1 2 0 012 Transported 0 Elapsed time 0s Transported/s 0.00 Avg waiting time 0.0s Max waiting time 0.0s Moves 0 1 { 2 init: function(elevators, floors) { 3 var elevator = elevators[0]; // Let's use the first elevator 4 ​ 5 // Whenever the elevator is idle (has no more queued destinations) ... 6 elevator.on("idle", function() { 7 // let's go to all the floors (or did we forget one?) 8 elevator.goToFloor(0); 9 elevator.goToFloor(1); 10 }); 11 }, 12 update: function(dt, elevators, floors) { 13 // We normally don't need to do anything here 14 } 15 } Reset Undo reset Apply Save Confused? Open the Help and API documentation page Made by Magnus Wolffelt and contributors Version 1.6.5 Source code on GitHub Run tests

Challenge #1: Transport 15 people in 60 seconds or less 2x 0 1 2 0 012 Transported0 Elapsed time0s Transported/s0.00 Avg waiting time0.0s Max waiting time0.0s Moves0 ​x 15 1 { 2 init: function(elevators, floors) { 3 var elevator = elevators[0]; // Let's use the first elevator 4 ​ 5 // Whenever the elevator is idle (has no more queued destinations) ... 6 elevator.on("idle", function() { 7 // let's go to all the floors (or did we forget one?) 8 elevator.goToFloor(0); 9 elevator.goToFloor(1); 10 }); 11 }, 12 update: function(dt, elevators, floors) { 13 //…

saved by

related reading