Skip to content

Instantly share code, notes, and snippets.

@heatherbooker
heatherbooker / ticTacToe.js
Last active September 6, 2016 20:54
Command line tic tac toe
var readline = require('readline');
var rl = readline.createInterface({
input: process.stdin,
output: process.stdout
});
function printBoard(board) {
console.log(`
@heatherbooker
heatherbooker / deepEqual.js
Last active August 30, 2016 22:01
Implementation of recursive 'deepEqual' function as suggested in Eloquent Javascript
// 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) {