-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
36 lines (27 loc) · 881 Bytes
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<?php
namespace chess;
require __DIR__ . '/vendor/autoload.php';
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
require_once './template/top.php';
require_once './objects/piece.php';
require_once './objects/chessBoard.php';
$chessBoard = new ChessBoard();
$chessBoard->SetStart();
$chessBoard->move("Horse","B1", "C3");
$chessBoard->move("Horse","B8", "A6");
$chessBoard->move("Pawn", "A2", "A4");
//$chessBoard->Draw();
$chessBoard->Draw();
echo "<h1>FEN notation</h1>";
echo "FEN notatie: {$chessBoard->GetFENNotation()}";
echo "<h1>Analysis</h1>";
$analysis = $chessBoard->GetAnalysis($chessBoard->GetFENNotation());
Lines:
echo "<ul>";
foreach($analysis->pvs as $moveVariation){
echo "<li>" . $moveVariation->moves . " eval: ". $moveVariation->cp / 100 . "</li>";
}
echo "</ul>";
require_once './template/bottom.php';