예제 #1
0
 public function move(Game $game, $level)
 {
     $forsythe = new Forsythe();
     $oldForsythe = $forsythe->export($game);
     $newForsythe = $this->getNewForsythe($oldForsythe, $level);
     $move = $forsythe->diffToMove($game, $newForsythe);
     return $move;
 }
예제 #2
0
 public function testDiffToMove()
 {
     $generator = new Generator();
     $game = $generator->createGame();
     $manipulator = new Manipulator($game->getBoard());
     $forsythe = new Forsythe();
     $this->assertEquals(null, $forsythe->diffToMove($game, 'rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq'));
     $this->assertEquals('e2 e4', $forsythe->diffToMove($game, 'rnbqkbnr/pppppppp/8/8/4P3/8/PPPP1PPP/RNBQKBNR b KQkq'));
 }