Tathagat27 / php-chess

A chess library for PHP.

Home Page:https://www.chesslablab.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PHP Chess

Latest Stable Version GitHub Workflow Status License: GPL v3

A chess library for PHP.

Install

Via composer:

$ composer require chesslablab/php-chess

Play Chess

Variants:

  • Chess\Game::VARIANT_960
  • Chess\Game::VARIANT_CLASSICAL

Modes:

  • Chess\Game::MODE_ANALYSIS
  • Chess\Game::MODE_GM
  • Chess\Game::MODE_FEN
  • Chess\Game::MODE_PGN
  • Chess\Game::MODE_PLAY
  • Chess\Game::MODE_STOCKFISH
use Chess\Game;

$game = new Game(
    Game::VARIANT_CLASSICAL,
    Game::MODE_ANALYSIS
);

$game->play('w', 'e4');
$game->play('b', 'e5');

The call to the $game->play method returns true or false depending on whether or not a chess move can be made.

Documentation

Read the latest docs here.

Demo

Check out this demo.

License

The GNU General Public License.

Contributions

See the contributing guidelines.

Happy learning and coding! Thank you, and keep it up.

About

A chess library for PHP.

https://www.chesslablab.com/

License:GNU General Public License v3.0


Languages

Language:PHP 100.0%