tictactoe.io
v1.0.1
Published
A package you can use to create a tictactoe game
Downloads
1
Maintainers
Readme
TicTacToe Package
A package you can use to create a TicTacToe game
Documentation
Setup
const TictTacToe = require('tictactoe.io');
Create game
const Game = new TicTacToe.Game("Foo" /*First player*/, "Bar" /*Second player*/);
Place field
Game.place("Foo" /*The player doing this move*/, 3 /*number from 1 to 9*/);
Get Board
Game.getBoard().then((response) => {
console.log(response.board || Game.board);
});
Get Board As Text
Game.getBoard().then((response) => {
console.log(response.textBoard || Game.textBoard);
});
Get turn
Game.getBoard().then((response) => {
console.log(response.turn || Game.turn);
});