/noughts-and-crosses

A Laravel package, can be installed via composer.

Primary LanguagePHP

Noughts and Crosses (A laravel package)

This is a package creation test, it contains some logic that mimics a simple "Noughts and Crosses" game.

Use, composer require superme2018/noughts-and-crosses to add to your project.

// Namespace to import into controller and or class:
use SuperMe2018\NoughtsAndCrosses\NoughtsAndCrosses;

// Player move array format (can take player 1 or player 2)
$playerMove = ["playerId" => 1, "moveId" => 4];

// Instance and usage.
$noughtsAndCrosses = new NoughtsAndCrosses();
return $noughtsAndCrosses->makeMove($playerMove);

or

(new NoughtsAndCrosses)->makeMove(($playerMove);