Skip to content

Instantly share code, notes, and snippets.

View jasenkoh's full-sized avatar

Jasenko Hadziomeragic jasenkoh

  • https://pleo.io
  • Tuzla, Bosnia and Herzegowina
View GitHub Profile
@francois
francois / elevator-sol-6-and-less.js
Created August 16, 2015 18:35
These represent successive solutions to the [Elevator Saga](http://play.elevatorsaga.com/)
{
init: function(elevators, floors) {
var waitingFloors = [];
floors.forEach(function(floor) {
floor.on("up_button_pressed", function() {
waitingFloors.push(floor.floorNum());
});
floor.on("down_button_pressed", function() {
waitingFloors.push(floor.floorNum());