william #1

Merged
william merged 6 commits from william into master 2023-03-21 18:08:15 -04:00
2 changed files with 7 additions and 5 deletions
Showing only changes of commit 86e3b5acc2 - Show all commits

View File

@ -48,8 +48,8 @@ public class PusherBoard {
public int move(int from_col, int from_row, int to_col, int to_row){
//FORMAT ex : from_col {3}, from_row {2}, to_col {3}, to_row {3}
System.out.println("Move :" + from_col+""+from_row + "-"+ to_col+""+to_row);
System.out.println("Move is valid : " + isValid(from_col,from_row,to_col,to_row));
//System.out.println("Move :" + from_col+""+from_row + "-"+ to_col+""+to_row);
//System.out.println("Move is valid : " + isValid(from_col,from_row,to_col,to_row));
if(isValid(from_col,from_row,to_col,to_row)){
Pawn pawn = this.getBoard()[from_row][from_col];

View File

@ -3,6 +3,11 @@ package laboratoire4;
public class Test {
public static void main(String[] args) {
PusherBoard pusherBoard = new PusherBoard();
testMoves(pusherBoard);
pusherBoard.printBoard();
}
private static void testMoves(PusherBoard pusherBoard){
//Move examples
pusherBoard.move("D2","D3");
pusherBoard.move("C2","C3");
@ -20,8 +25,5 @@ public class Test {
pusherBoard.move("A8","A7");
pusherBoard.move("D3","D4");
pusherBoard.move("C3","D4");
pusherBoard.printBoard();
}
}