Comparing version 0.0.1 to 0.0.2
22
bin.js
@@ -11,9 +11,5 @@ #!/usr/bin/env node | ||
Connect4Grid = require('./connect'), | ||
argv = require('optimist') | ||
.usage('Usage: connect4 -w [num] -h [num] -p [num]') | ||
.boolean('c') | ||
.default('w', 7) | ||
.default('h', 6) | ||
.default('p', 2) | ||
.argv, | ||
args = require('optimist') | ||
.usage("connect4 -w [num] -h [num] -p [num]") | ||
.default({ w: 7, h: 6, p: 2 }), | ||
colors = ['bgRed', 'bgGreen', 'bgYellow', 'bgBlue', 'bgMagenta', 'bgCyan'], | ||
@@ -33,7 +29,13 @@ shuffle = function(array){ | ||
}, | ||
blank = clc.bgBlack(" "), | ||
rl, grid, setPrompt, finish, colorize; | ||
rl, grid, setPrompt, finish, colorize, argv; | ||
argv = args.argv; | ||
if(argv.help){ | ||
process.stdout.write(args.help()); | ||
process.exit(0); | ||
} | ||
rl = readline.createInterface(process.stdin, process.stdout); | ||
grid = new Connect4Grid(argv.w, argv.h, argv.p, { color: argv.c }); | ||
grid = new Connect4Grid(argv.w, argv.h, argv.p); | ||
@@ -40,0 +42,0 @@ colorize = function(player){ |
{ | ||
"name": "connect4", | ||
"description": "connect 4, in node, why not", | ||
"version": "0.0.1", | ||
"main": "app.js", | ||
"version": "0.0.2", | ||
"main": "connect.coffee", | ||
"bin": { | ||
@@ -7,0 +7,0 @@ "connect4": "./bin.js" |
7415
6