This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Compare function for sort: | |
// Move 'jack' forward first, then 'jill' if no 'jack'; leave other values unsorted | |
function compare(a, b){ | |
if (a === 'jack'){ | |
return -1; | |
} else if (b === 'jack') { | |
return 1; | |
} else if (a === 'jill') { | |
return -1; | |
} else if (b === 'jill') { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Keybase proof | |
I hereby claim: | |
* I am stackptr on github. | |
* I am mu (https://keybase.io/mu) on keybase. | |
* I have a public key whose fingerprint is 5AEA 8B12 0FA1 AC7E 85B3 7A66 CD98 C2EE 053F E0BA | |
To claim this, I am signing this object: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var rl = require('readline').createInterface({ | |
input: process.stdin, | |
output: process.stdout | |
}); | |
function Point(x, y){ | |
this.x = x; | |
this.y = y; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var graph = { | |
rows: [] | |
} | |
graph.readLine = function(line){ | |
if (line == "") return; | |
this.rows.push(line); | |
} |