# ttt-board

> A simple TicTacToe package for NodeJS

Latest version **1.0.4** (published 2022-11-23) · MIT license · 0 weekly downloads

## Install

```sh
npm install ttt-board
pnpm add ttt-board
yarn add ttt-board
bun add ttt-board
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.4 |
| Published | 2022-11-23 |
| First published | 2022-11-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 4.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | EntropicBlackhole |
| Maintainers | entropicblackhole |
| Keywords | ttt, tictactoe |

## Links

- npm: https://www.npmjs.com/package/ttt-board
- Repository: https://github.com/EntropicBlackhole/ttt-board
- Homepage: https://github.com/EntropicBlackhole/ttt-board#readme
- Issues: https://github.com/EntropicBlackhole/ttt-board/issues
- npm.io page: https://npm.io/package/ttt-board

## Recent versions

- 1.0.4 (latest) — 2022-11-23
- 1.0.3 — 2022-11-23
- 1.0.2 — 2022-11-23
- 1.0.1 — 2022-11-23
- 1.0.0 — 2022-11-23

## README

# TTT Board

> A simple TicTacToe package for NodeJS, uses an Object Matrix type implementation for the board. Automatically takes care of turns and the board, simply move, get outputs and check if it's finished

## Installation

```sh
$ npm install ttt-board
```

### Running the tests

```sh
$ npm run test-ttt
```

## Getting started
Basically just set it up
```js
const ttt = new TTTBoard();

ttt.move("A", "2") // This uses an ABC 123 system, ABC for rows and 123 for columns, to move simply place ttt.move("A", "2") for example, top center, automatically turns to uppercase if lowercase
ttt.AImove() //Really is just a random move but it's cool to call it AI

let boardConfig = ttt.outputBoard() //Returns the board in it's config format, basically an object matrix
let boardImage = ttt.displayBoard() //Returns the board in a PNG format, just an image of the board
let boardASCII = ttt.writeBoard() //Returns the board in ASCII format (as a string), so you can write it to console! 

ttt.isFinished() //Returns true if the match has finished, to avoid making any more moves
ttt.turn() //Returns X or O depending on who's turn it is. When winning, ttt.turn() will output the winning letter
```

---
_Source: https://npm.io/package/ttt-board · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
