2017 © Pedro Peláez
 

library tictactoe

Another TicTacToe implementation in PHP.

image

alcalyn/tictactoe

Another TicTacToe implementation in PHP.

  • Monday, February 1, 2016
  • by alcalyn
  • Repository
  • 0 Watchers
  • 0 Stars
  • 530 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

TicTacToe

Another TicTacToe implementation in PHP., (*1)

Download

With composer:, (*2)

``` json "alcalyn/tictactoe": "1.0.x",, (*3)



## Usage ``` php use Alcalyn\TicTacToe\TicTacToe; $grid = new TicTacToe(); $grid->play(1, 1, TicTacToe::X); // X plays middle $grid->play(0, 2, TicTacToe::O); // O plays bottom left // Is left empty ? $grid->isEmpty(0, 1); $grid->getCurrentPlayer(); // Returns TicTacToe::X or TicTacToe::O $grid->getWinner(); // Returns TicTacToe::X, TicTacToe::O, TicTacToe::DRAW or null for no winner. $grid->getBrochette(); // Returns the 3-in-a-row if there is (or null), with the numbers of the squares: // Example: [2, 4, 6] /* Grid: 0 1 2 3 4 5 6 7 8 */

See the complete TicTacToe class., (*4)

License

This library is under the MIT license., (*5)

The Versions

01/02 2016

dev-master

9999999-dev https://github.com/alcalyn/tictactoe

Another TicTacToe implementation in PHP.

  Sources   Download

MIT

The Requires

  • php >=5.3

 

01/02 2016

1.0.0

1.0.0.0 https://github.com/alcalyn/tictactoe

Another TicTacToe implementation in PHP.

  Sources   Download

MIT

The Requires

  • php >=5.3