Skip to content

Instantly share code, notes, and snippets.

View jnewc's full-sized avatar

Jack Newcombe jnewc

View GitHub Profile
@jnewc
jnewc / elevator-saga-simple
Last active August 29, 2015 14:14
Elevator Saga Simple Algorithm ( < Challenge 6)
{
init: function(elevators, floors) {
var findElevator = function() {
return _.find(elevators, function(e) { return e.loadFactor() < 0.5; });
};
var setupFloor = function(floor) {
floor.on('up_button_pressed', function(floorNum) {
console.log("UP: ", this.level);