https://github.com/dinoscapeprogramming/tictactoe-package
A package you can use to create a tictactoe game
https://github.com/dinoscapeprogramming/tictactoe-package
Last synced: about 1 year ago
JSON representation
A package you can use to create a tictactoe game
- Host: GitHub
- URL: https://github.com/dinoscapeprogramming/tictactoe-package
- Owner: DinoscapeProgramming
- License: apache-2.0
- Created: 2022-09-11T10:56:25.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2022-09-16T16:00:25.000Z (almost 4 years ago)
- Last Synced: 2025-03-16T07:16:15.257Z (over 1 year ago)
- Language: JavaScript
- Size: 15.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# TicTacToe Package
A package you can use to create a TicTacToe game
## Documentation
### Setup
```js
const TictTacToe = require('tictactoe.io');
```
### Create game
```js
const Game = new TicTacToe.Game("Foo" /*First player*/, "Bar" /*Second player*/);
```
### Place field
```js
Game.place("Foo" /*The player doing this move*/, 3 /*number from 1 to 9*/);
```
### Get Board
```js
Game.getBoard().then((response) => {
console.log(response.board || Game.board);
});
```
### Get Board As Text
```js
Game.getBoard().then((response) => {
console.log(response.textBoard || Game.textBoard);
});
```
### Get turn
```js
Game.getBoard().then((response) => {
console.log(response.turn || Game.turn);
});
```