gonza4/tic-tac-toe-sdk-php

Api clietn to play Tic Tac Toe

1.0.0 2019-04-22 05:37 UTC

This package is not auto-updated.

Last update: 2025-06-08 09:10:14 UTC


README

A PHP library to play Tic Tac Toe through the Tic Tac Toe API.

Requirements

PHP 5.6 and later.

Composer

You can install the SDK via Composer. Run the following command:

composer require gonza4/tic-tac-toe-sdk-php

To use the SDK, use Composer's autoload:

require_once('vendor/autoload.php');

Dependencies

The SDK require the following extensions in order to work properly:

  • curl, although you can use your own non-cURL client if you prefer
  • json

If you use Composer, these dependencies should be handled automatically. If you install manually, you'll want to make sure that these extensions are available.

Getting Started

Simple usage looks like:

  • Create a instance of the TicTacToe Client
    $tictactoe = new \Gonza4\TicTacToe();
  • Generate empty board
    $result = $tictactoe->getEmptyBoard();
    var_dump($result);
  • Make a move
    $result = $tictactoe->postPlayGame(1);
    var_dump($result);