PHPackages                             andreluizmachado/tictactoe-library - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. andreluizmachado/tictactoe-library

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

andreluizmachado/tictactoe-library
==================================

The tic tac toe engine

031PHP

Since Mar 19Pushed 8y ago1 watchersCompare

[ Source](https://github.com/andreluizmachado/tictactoe-library)[ Packagist](https://packagist.org/packages/andreluizmachado/tictactoe-library)[ RSS](/packages/andreluizmachado-tictactoe-library/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

Tic Tac Toe Library
===================

[](#tic-tac-toe-library)

The engine of the tic tac tog game

Getting Started
---------------

[](#getting-started)

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

### Prerequisites

[](#prerequisites)

- Docker &gt;= v17.05
- php &gt;= 7.2

### Installing

[](#installing)

```
composer require andreluizmachado/tictactoe-library

```

Usage
-----

[](#usage)

To get the next move by bot:

```
    use AndreLuizMachado\TicTacToe\Engine\Bot;
    ...
    $bot = new Bot(
        [ //previous plays of current game
            [
                'column' => 3,
                'line' => 3,
            ],
        ]
    );

    $nextPlay = $bot->getNextPlay();
    var_dump($nextPlay);
    ....
```

To check the board

```
    use AndreLuizMachado\TicTacToe\Engine\Board;
    use AndreLuizMachado\TicTacToe\Engine\Player;
    ...
        $player2 = new Player(
            [
                [
                    'column' => 3,
                    'line' => 2,
                ],
                [
                    'column' => 3,
                    'line' => 3,
                ],
            ]
        );

        $player1 = new Player(
            [
            [
                    'column' => 1,
                    'line' => 1,
                ],
                [
                    'column' => 1,
                    'line' => 2,
                ],
                [
                    'column' => 1,
                    'line' => 3,
                ],
            ]
        );

        $board = new Board($player1, $player2);
        $game = $board->checkGame();
        var_dump($game);
    ....
```

Running the tests
-----------------

[](#running-the-tests)

```
./run-install.sh
./run-testing.sh

```

Authors
-------

[](#authors)

[André Luiz Machado](https://github.com/andreluizmachado)

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/f793d928cd726bdb12b636c53168e9a1e972b6a4fa5fd29bbdf1cbf031b5c0f1?d=identicon)[andre.luiz.kbca@gmail.com](/maintainers/andre.luiz.kbca@gmail.com)

---

Top Contributors

[![andreluizmachado](https://avatars.githubusercontent.com/u/11900046?v=4)](https://github.com/andreluizmachado "andreluizmachado (11 commits)")

### Embed Badge

![Health badge](/badges/andreluizmachado-tictactoe-library/health.svg)

```
[![Health](https://phpackages.com/badges/andreluizmachado-tictactoe-library/health.svg)](https://phpackages.com/packages/andreluizmachado-tictactoe-library)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
