mirror of
https://github.com/sigmasternchen/php-chess
synced 2025-03-15 07:58:54 +00:00
fix: Mirrored board
This commit is contained in:
parent
18861302e6
commit
4aace35222
1 changed files with 1 additions and 1 deletions
|
@ -41,7 +41,7 @@ function getImageForPice(Piece $piece): string {
|
||||||
>
|
>
|
||||||
<?php
|
<?php
|
||||||
for($rank = $start; $rank != $end; $rank += $dir) {
|
for($rank = $start; $rank != $end; $rank += $dir) {
|
||||||
for($file = $start; $file != $end; $file += $dir) {
|
for($file = 7-$start; $file != 7-$end; $file -= $dir) {
|
||||||
$position = new Position($file, $rank);
|
$position = new Position($file, $rank);
|
||||||
$piece = $game->getPiece($position);
|
$piece = $game->getPiece($position);
|
||||||
$moves = $piece ? $game->getMovesForPiece($piece) : [];
|
$moves = $piece ? $game->getMovesForPiece($piece) : [];
|
||||||
|
|
Loading…
Reference in a new issue