Compare commits
2 Commits
0890c79bd5
...
5cc24e4348
| Author | SHA1 | Date |
|---|---|---|
|
|
5cc24e4348 | |
|
|
318be7fb35 |
|
|
@ -14,12 +14,12 @@ public class Main {
|
|||
// testing :
|
||||
//testing the board
|
||||
Board testBoard = new Board(8, 8);
|
||||
//getting the pieces on the board
|
||||
testBoard.populateBoard();
|
||||
System.out.println(testBoard.getWidth());
|
||||
System.out.println(testBoard.getHeight());
|
||||
System.out.println(testBoard.toString());
|
||||
|
||||
|
||||
//testing the pieces coordinates, colour and type
|
||||
Piece testPiece= new Piece(1,2, PieceType.Rook, false);
|
||||
System.out.println(testPiece.getX());
|
||||
|
|
@ -28,21 +28,22 @@ public class Main {
|
|||
System.out.println(testPiece.isWhite());
|
||||
|
||||
//getting the pieces on the board
|
||||
System.out.println(testBoard.getPieces());
|
||||
|
||||
testBoard.setPiece(false, PieceType.Knight, 4, 4);
|
||||
testBoard.setPiece(false, PieceType.Queen, 3, 3);
|
||||
|
||||
|
||||
//clean the board
|
||||
|
||||
|
||||
ArrayList<Piece> allPieces=testBoard.getPieces();
|
||||
for (Piece piece:allPieces) {
|
||||
System.out.println((piece.isWhite() ? "White ":"Black ")+ piece.getType().getSummary()+" located at "+ piece.getX()+ "," + piece.getY());
|
||||
}
|
||||
|
||||
//adding new piece to the board
|
||||
testBoard.setPiece(true, PieceType.Bishop, 4, 7);
|
||||
testBoard.toString();
|
||||
|
||||
|
||||
// launches graphical interface :
|
||||
MyInterface mjf = new MyInterface();
|
||||
mjf.setVisible(true);
|
||||
|
||||
//cleaning the board
|
||||
testBoard.cleanBoard();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue