@socialgorithm/ultimate-ttt
TypeScript icon, indicating that this package has built-in type declarations

10.2.1 • Public • Published

Ultimate Tic Tac Toe - Game Engine

Ultimate Tic Tac Toe implementation for algorithmic battles & hackathons :)

Travis npm Coverage Status npm npm

This is a JavaScript implementation of the Ultimate Tic Tac Toe game.

What this package provides is a class that holds all game state and performs all required logic, exposing a simple API.

Example state at a given point:

import UTTT from '@socialgorithm/ultimate-ttt';

const game = new UTTT();

// ... perform some moves ...

console.log(game.prettyPrint());

/*

Outputs the following:

1 - - | - - - | - - -
0 - - | - - - | - - -
1 - - | 1 - - | - - -
------+-------+-------
1 - - | - - - | - - -
- - - | - - - | - - -
- - - | - - - | - - -
------+-------+-------
- 1 - | - - - | - - -
- - - | - - - | - - -
- - - | - - - | - - -
------+-------+-------
*/

Getting started

Install from npm:

$ npm install --save @socialgorithm/ultimate-ttt

Import and use:

import UTTT from '@socialgorithm/ultimate-ttt';
const game = new UTTT();

API Documentation

Projects using this

  • ultimate-ttt-player-js UTTT Algorithm that plays at random, provided as a base for your own algorithms!
  • ultimate-ttt/server: Game server that uses this package as a game engine to pitch two playing algorithms against each other.

Readme

Keywords

Package Sidebar

Install

npm i @socialgorithm/ultimate-ttt

Weekly Downloads

8

Version

10.2.1

License

MIT

Unpacked Size

899 kB

Total Files

78

Last publish

Collaborators

  • socialgorithm-bot
  • gyorokpeter
  • aurbano
  • reddyalready