Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fen() method #72

Open
Hejazi23 opened this issue Jan 5, 2025 · 0 comments
Open

fen() method #72

Hejazi23 opened this issue Jan 5, 2025 · 0 comments

Comments

@Hejazi23
Copy link

Hejazi23 commented Jan 5, 2025

Hello
I simply did some change on your sample code like this:

//require 'vendor/autoload.php';
include "./src/Piece.php";
include "./src/Board.php";
include "./src/Move.php";
include "./src/Validation.php";
include "./src/History.php";
include "./src/Entry.php";
//include "./src/

include "./src/Chess.php";
include "./src/Output/BasicOutput.php";
//include "./src/Output/UnicodeOutput.php";
//include "./src/Output/OutputInterface.php";

use \PChess\Chess\Chess;
use \PChess\Chess\Output\UnicodeOutput;

$cnt=0;
$chess = new Chess();
while (!$chess->gameOver() && (++$cnt<=100) ) {
$moves = $chess->moves();
$move = $moves[random_int(0, count($moves) - 1)];
echo $move."
";
$chess->move($move);
echo $chess->fen()."
";
}

The problem is that "fen" method always the same result without any errors or exceptions.
it seems that the board is not changing. What is going wrong ? Did I miss something
( PHP Version is 8.3.14 )
Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant