2017 © Pedro PelĂĄez
 

library tictactoe-library

The tic tac toe engine

image

andreluizmachado/tictactoe-library

The tic tac toe engine

  • Monday, March 19, 2018
  • by andre.luiz.kbca@gmail.com
  • Repository
  • 1 Watchers
  • 1 Stars
  • 30 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Tic Tac Toe Library

The engine of the tic tac tog game, (*1)

Getting Started

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

Prerequisites

  • Docker >= v17.05
  • php >= 7.2

Installing

composer require andreluizmachado/tictactoe-library

Usage

To get the next move by bot:, (*3)

    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, (*4)

    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

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

Authors

André Luiz Machado, (*5)

The Versions

19/03 2018

dev-master

9999999-dev

The tic tac toe engine

  Sources   Download

The Requires

  • php ^7.2

 

The Development Requires

by André Luiz Machado