diff --git a/src/tests/TestMoves.java b/src/tests/TestMoves.java index ef2fd4e..c2f2998 100644 --- a/src/tests/TestMoves.java +++ b/src/tests/TestMoves.java @@ -55,7 +55,9 @@ public class TestMoves { Piece movePiece = new Piece(whatMove.toCharArray()[0],playerColor); if (whatMove.length()==6) { theMove = new MoveTest(whatMove.substring(2,6),movePiece); - } else { + } else if(whatMove.length()==7){ //promotion + theMove = new MoveTest(whatMove.substring(2,7),movePiece); + } else if (whatMove.length()==8){ //capture sans promotion Piece capturePiece; if (playerColor==Piece.WHITE) { capturePiece = new Piece(whatMove.toCharArray()[7],Piece.BLACK); @@ -64,6 +66,15 @@ public class TestMoves { capturePiece = new Piece(whatMove.toCharArray()[7],Piece.WHITE); theMove = new MoveTest(whatMove.substring(2,6),movePiece,capturePiece); } + } else { //capture avec promotion + Piece capturePiece; + if (playerColor==Piece.WHITE) { + capturePiece = new Piece(whatMove.toCharArray()[8],Piece.BLACK); + theMove = new MoveTest(whatMove.substring(2,7),movePiece,capturePiece); + } else { + capturePiece = new Piece(whatMove.toCharArray()[8],Piece.WHITE); + theMove = new MoveTest(whatMove.substring(2,7),movePiece,capturePiece); + } } theMove.display(); bitboard.doMove(theMove);