fix: ranks and files swapped in visualisation

This commit is contained in:
overflowerror 2024-01-06 21:40:37 +01:00
parent 73b090e9b7
commit e965c8b5af

View file

@ -279,7 +279,7 @@ class Game {
$color = ($rank % 2) ^ ($file % 2);
$result .= "\033[" . ($color ? 47 : 100) . "m";
$piece = current(array_filter($this->pieces, fn($p) => $p->getPosition()->equals(new Position($rank, $file))));
$piece = current(array_filter($this->pieces, fn($p) => $p->getPosition()->equals(new Position($file, $rank))));
if ($piece) {
if ($piece->getSide() == Side::WHITE) {
$result .= "\033[97m";