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.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
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
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package kesty/uci-chess contains the following files

Loading the files please wait ....