Skip to content

Instantly share code, notes, and snippets.

@phlco
Created July 25, 2013 15:12
Show Gist options
  • Select an option

  • Save phlco/6080705 to your computer and use it in GitHub Desktop.

Select an option

Save phlco/6080705 to your computer and use it in GitHub Desktop.
var lStations = [ "8th", "6th", "Union Square", "3rd", "1st" ];
var nStations = [ "Times Square", "34th", "28th", "23rd", "Union Square", "8th" ];
var sixStations = [ "Grand Central", "33rd", "28th", "23rd", "Union Square", "Astor Place" ];
var gStations = [ "Greenpoint", "Nassau", "Metropolitan", "Broadway" ];
// write a function that accepts a line, and returns a function
// to calculate the distance between two stops on one line
function getDistanceForLine(line){
// code here?
return function(board, exit) {
// code here!
};
}
// e.g.,
// var getLDistance = getDistanceForLine(lStations);
// getLDistance('8th','6th');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment