File: crosswords/start.js

Recommend this page to a friend!
  Classes of Igor Escobar   Terminal Crossword   crosswords/start.js   Download  
File: crosswords/start.js
Role: Example script
Content type: text/plain
Description: Example script
Class: Terminal Crossword
Generate a crosswords board on a text console
Author: By
Last change:
Date: 2 years ago
Size: 786 bytes
 

Contents

Class file image Download
/* How to play: - node start.js - node start.js --noobie - node start.js --words word1,word2,word3,word4 */ var readline = require('readline'), CrossWords = require('./crosswords'), game = new CrossWords(); if(game.wordsShortCut === false) { var rl = readline.createInterface(process.stdin, process.stdout); rl.question("Type the words that you want to " + "include on crossword game separed by comma: ", function(words) { game.processTypedWords(words); process.exit(1); rl.close(); }); } else { game.processTypedWords(process.argv[3]); } process.on('exit', function () { game.registerWordsOnBoard(); console.log(game.showBoard()); console.log('Have fun! :)'); });