Download the PHP package kesty/uci-chess without Composer
On this page you can find all versions of the php package kesty/uci-chess. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download kesty/uci-chess
More information about kesty/uci-chess
Files in kesty/uci-chess
Download kesty/uci-chess
More information about kesty/uci-chess
Files in kesty/uci-chess
Vendor kesty
Package uci-chess
Short Description Wrappers to run UCI chess engines, matches and tournaments
License MIT
Package uci-chess
Short Description Wrappers to run UCI chess engines, matches and tournaments
License MIT
Please rate this library. Is it a good library?
Informations about the package uci-chess
uci-chess
PHP wrapper classes for interfacing with UCI chess engines.
Getting started
From the root of your application
composer require kesty/uci-chess
Unless using a framework where autoloading is already taken care of, you'll need to
include 'vendor/autoload.php';
Then, include the classes that you want to use, e.g.
use Netsensia\Uci\Engine;
use Netsensia\Uci\Match;
use Netsensia\Uci\Tournament\RoundRobin;
Search for a move
$engine = new Engine();
// Native application or Jar file?
$engine->setApplicationType(Engine::APPLICATION_TYPE_JAR);
// The location of the chess engine on the local file system
// You can download my engine, RivalChess from https://github.com/chris-moreton/rival-chess-android-engine/tree/master/dist
// If the engine requires any parameters, simply add them after the path
$engine->setEngineLocation('/path/to/engine.jar [params]');
// Set engine parameters
$engine->setMode(Engine::MODE_NODES);
$engine->setModeValue(100000);
// Set the starting position of the match (before any moves have been played)
$engine->setPosition(Engine::STARTPOS);
// Send the move history and get the move
$move = $engine->getMove('e2e4 d7d5');
// Important! - remove the process
$engine->unloadEngine();
Run a match
$whiteEngine = new Engine('/path/to/engine1.jar');
// No reason why you can't use the same engine if you want to test against different parameters
$blackEngine = new Engine('/path/to/engine2.jar');
$whiteEngine->setMode(Engine::MODE_NODES);
$whiteEngine->setModeValue(100);
$whiteEngine->setApplicationType(Engine::APPLICATION_TYPE_JAR);
$whiteEngine->setLogEngineOutput(false);
$blackEngine->setMode(Engine::MODE_NODES);
$blackEngine->setModeValue(10000);
$blackEngine->setApplicationType(Engine::APPLICATION_TYPE_JAR);
$blackEngine->setLogEngineOutput(false);
$match = new Match($whiteEngine, $blackEngine);
$result = $match->play();
echo $result['fen'] . PHP_EOL;
switch ($result['result']) {
case Match::DRAW: echo 'Draw';
break;
case Match::WHITE_WIN: echo 'White win';
break;
case Match::BLACK_WIN: echo 'Black win';
break;
}
$whiteEngine->unloadEngine();
$blackEngine->unloadEngine();
Run a tournament
$tournament = new RoundRobin();
// for each engine...
$engine = new Engine('/path/to/engine1.jar');
$engine->setMode(Engine::MODE_NODES);
$engine->setModeValue(100);
$engine->setApplicationType(Engine::APPLICATION_TYPE_JAR);
$engine->setLogEngineOutput(false);
$engine->setName('Engine 1');
$tournament->addEngine($engine);
...
foreach ($tournament->matches() as $match) {
echo $match->getWhite()->getName() . ' v ' . $match->getBlack()->getName() . PHP_EOL;
$tournament->play($match);
$echo $tournament->table();
}
$tournament->showTable();
$tournament->close();
All versions of uci-chess with dependencies
PHP Build Version
Package Version
Requires
php Version
^8.0
ryanhs/chess.php Version 1.0.3
chris-moreton/tournament-utils Version 1.*
zelenin/elo Version dev-master
aws/aws-sdk-php Version ^3.231
ryanhs/chess.php Version 1.0.3
chris-moreton/tournament-utils Version 1.*
zelenin/elo Version dev-master
aws/aws-sdk-php Version ^3.231
The package kesty/uci-chess contains the following files
Loading the files please wait ....