# tic-tac-toe-playing-algorithms

> Algorithms for playing a 3x3 Tic Tac Toe Game

Latest version **1.0.3** (published 2018-06-28) · MIT license · 0 weekly downloads

## Install

```sh
npm install tic-tac-toe-playing-algorithms
pnpm add tic-tac-toe-playing-algorithms
yarn add tic-tac-toe-playing-algorithms
bun add tic-tac-toe-playing-algorithms
```

## 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.3 |
| Published | 2018-06-28 |
| First published | 2018-06-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Socret Lee |
| Maintainers | socret360 |

## Links

- npm: https://www.npmjs.com/package/tic-tac-toe-playing-algorithms
- npm.io page: https://npm.io/package/tic-tac-toe-playing-algorithms

## Recent versions

- 1.0.3 (latest) — 2018-06-28
- 1.0.2 — 2018-06-28
- 1.0.1 — 2018-06-28
- 1.0.0 — 2018-06-28

## README

## Tic Tac Toe Playing Algorithms

An implementation of various algorithms for playing a 3x3 tic tac toe game.

#### The algorithms includes:

- Minimax

## Usage

ES5:

```
var minimax = require ('tic-tac-toe-playing-algorithms').minimax;

var myPlayer = 'X';
var otherPlayer = 'O';
var currentPlayer = myPlayer;

var board = [
	[0, 0, 0],
	[0, 0, 0],
	[0, 0, 0]
];

var nextMove = minimax(board, currentPlayer, myPlayer, otherPlayer);

console.log(nextMove);
```

ES6:

```
import { minimax } from 'tic-tac-toe-playing-algorithms';

const myPlayer = 'X';
const otherPlayer = 'O';
const currentPlayer = myPlayer;

const board = [
	[0, 0, 0],
	[0, 0, 0],
	[0, 0, 0]
];

const nextMove = minimax(board, currentPlayer, myPlayer, otherPlayer);

console.log(nextMove);
```

---
_Source: https://npm.io/package/tic-tac-toe-playing-algorithms · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
