tic-tac-toe-eng-fcc
A tic-tac-toe cpu engine for a freeCodeCamp project
Installation
Install it via npm
npm install --save ttt-eng-fcc
Usage
This module is to emulate a tic-tac-toe game against the cpu. It all depends on the state of the game. So all you going to do is something like this:
const gameEngine = gameEngine // In production, you should use gameEngine.cpuFirstPlayer()// to decide who will go first. For demos purposes, assume the// startswhile !gameEngine let humanInput = // setPlay only accepts integers that are between 0 and 8 // (both inclusive) while !gameEngine humanInput = // here the gameEngine will compute the best move for THAT turn gameEngine
Contribution
For the moment I'm not accepting pull requests. This is because I need to test the coverage of the code when someone makes a PR and I haven't configured codecov yet.