test of problemating pgn

This commit is contained in:
Alf Magne Kalleland
2013-02-12 00:58:18 +01:00
parent 61e2159841
commit b437127f6b
4 changed files with 102 additions and 16 deletions

View File

@@ -839,6 +839,8 @@ class FenParser0x88
function getFromAndToByNotation($notation)
{
$notation = str_replace(".","", $notation);
$ret = array('promoteTo' => $this->getPromoteByNotation($notation));
$color = $this->getColor();
$offset = 0;
@@ -967,7 +969,7 @@ class FenParser0x88
}
if(!isset($ret['from'])){
$msg = "Fen: ".$this->fen ."\nnotation: ". $notation."\nRank:". $fromRank. "\nFile:". $fromFile."\n". count($foundPieces).", ". $foundPieces[0];
$msg = "Fen: ".$this->fen ."\ncolor: ". $color. "\nnotation: ". $notation."\nRank:". $fromRank. "\nFile:". $fromFile."\n". count($foundPieces).", ". implode(",", $foundPieces);
throw new Exception($msg);
}
$ret['from'] = Board0x88Config::$numberToSquareMapping[$ret['from']];