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
| 'use strict'; | |
| var prompt = require('prompt'); | |
| prompt.start(); | |
| var colors = require('colors/safe'); | |
| var board = [ | |
| ] |
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
| function displayTime() { | |
| var d = new Date(); | |
| var h = d.getHours(); | |
| var m = d.getMinutes(); | |
| var s = d.getSeconds(); | |
| var meridiem = "AM"; | |
| if( (h > 7) && (h < 19) ) { | |
| // document.body.style.backgroundColor="#80d4ea"; | |
| $('body').css('background-color', "#80d4ea"); |
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
| 'use strict'; | |
| var prompt = require('prompt'); | |
| prompt.start(); | |
| prompt.get(['word'], function(err, result) { | |
| var word = result['word']; | |
| var vowelIndex = word.indexOf('a'); | |
| if ( (word.indexOf('e') > -1 && word.indexOf('e') < vowelIndex) || (vowelIndex === -1) ) { |
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
| .DS_Store |
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
| 'use strict'; | |
| // https://www.youtube.com/watch?v=kPRA0W1kECg | |
| var LineByLineReader = require('line-by-line'); | |
| var prompt = require('prompt'); | |
| var wordList = new LineByLineReader('./sample_words.txt'); | |
| var words = []; |
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
| <!----> |
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
| $(document).ready(function() { | |
| var block; | |
| function checkForWin() { | |
| var gameWon = false; | |
| $('[data-stack]').each(function () { | |
| if ($(this).data('stack') !== 1 && $(this).children().length === 4) { | |
| gameWon = true; | |
| } | |
| }); |
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
| 'use strict'; | |
| $(document).ready(function() { | |
| var playerTurn = 'X'; | |
| $('[data-cell]').on('click', function() { | |
| $(this).text(playerTurn); | |
| checkForWin(); | |
| playerTurn = (playerTurn === 'X') ? 'O' : 'X'; | |
| }); |
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 colors = require('colors/safe'); | |
| var prompt = require('prompt'); | |
| function Checker(color, position) { | |
| this.team = color; | |
| this.symbol = null; | |
| if (color === 'red') { | |
| this.symbol = colors.red(String.fromCharCode(0x12022)); | |
| } else { |
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
| 'use strict'; | |
| var prompt = require('prompt'); | |
| prompt.start(); | |
| function compareHands(hand1, hand2) { | |
| if (hand1 === hand2) { | |
| return "It's a tie!"; | |
| } |