dovidmoshecrow / ai-tic-tac-toe

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ai-tic-tac-toe

a simple AI for tic-tac-toe

Installation

 npm i ai-tic-tac-toe

Usage

 let tictactoe = require('ai-tic-tac-toe');
 let board = ['x','x','o',
              '','o','',
              '','','']
let position = tictactoe.getmove(board,'x');//solve for x
console.log(position);
//=> 6

About


Languages

Language:JavaScript 100.0%