PHP code example of aglaia-resident / chess.php
1. Go to this page and download the library: Download aglaia-resident/chess.php library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
aglaia-resident / chess.php example snippets
yanhs\Chess\Chess;
$chess = new Chess();
while (!$chess->gameOver()) {
$moves = $chess->moves();
$move = $moves[mt_rand(0, count($moves) - 1)];
$chess->move($move);
}
echo $chess->ascii() . PHP_EOL;