dots-and-boxes

1.2.6 • Public • Published

dots-and-boxes

npm version GitHub version wcs badge MIT license

Play the Dots And Boxes game against computer. Play in console or use api for own user interface.

Console Game

npm start 

or german version

npm start l=de

API

Example

const {Game} = require('dots-and-boxes');
var game = new Game({size: {x:3,y:3}, level: 2});
 
console.log( game.executeUserTurn( '0 0 l' ) );

{ player: 1,
line: 0,
value: 1,
complete: false,
otherTurn: [ { player: 2, line: 12, value: 1, complete: false } ] }

console.log( game.board.stringify() );

example1

console.log( game.scores );

[ 9, 0, 0 ]

Readme

Keywords

Package Sidebar

Install

npm i dots-and-boxes

Weekly Downloads

6

Version

1.2.6

License

MIT

Unpacked Size

97 kB

Total Files

17

Last publish

Collaborators

  • willicommer