chesslablab / php-chess

A chess library for PHP.
https://chesslablab.github.io/php-chess/
MIT License
102 stars 46 forks source link

MoveText to Lan? #554

Open ngl5000 opened 3 months ago

ngl5000 commented 3 months ago

it says that Lan is supported, but i don't see how to get Lan formated moves out of the board object

programarivm commented 3 months ago

Thank you @ngl5000 for opening this issue.

The moves can be retrieved from the history array as described in this example.

$last = end($board->history);

$lan = $last['sq'] . $last['move']['sq']['next'];

I hope this helps.

ngl5000 commented 3 months ago

it does - thank you!

On Wed, Jun 19, 2024 at 10:12 AM Jordi Bassagana @.***> wrote:

Thank you @ngl5000 https://github.com/ngl5000 for opening this issue.

The moves can be retrieved from the history array as described in this example https://github.com/chesslablab/php-chess/blob/main/tests/unit/Variant/Classical/BoardTest.php#L151 .

$last = end($history); $lan = $last['sq'] . $last['move']['sq']['next'];

I hope this helps.

— Reply to this email directly, view it on GitHub https://github.com/chesslablab/php-chess/issues/554#issuecomment-2178821795, or unsubscribe https://github.com/notifications/unsubscribe-auth/AANPEFMSQ57HEBUVQZZ2UKLZIGGTFAVCNFSM6AAAAABJMYVDJCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNZYHAZDCNZZGU . You are receiving this because you were mentioned.Message ID: @.***>