This file contains hidden or 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 readline = require('readline'); | |
var rl = readline.createInterface({ | |
input: process.stdin, | |
output: process.stdout | |
}); | |
function printBoard(board) { | |
console.log(` |
This file contains hidden or 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
// deepEqual takes two variables and tests for property/value equality, recursively for objects. | |
// Idea for function and some examples for testing borrowed from ch.4 in Marijn Haverbeke's "Eloquent Javascript". | |
function deepEqual(obj1, obj2) { | |
if (typeof obj1 === typeof obj2) { | |
if (obj1 === obj2) { | |
return true; | |
} else if (obj1 && obj2) { |
NewerOlder