width and height method working - can be changed also

This commit is contained in:
Jérôme BEDIER 2025-04-18 15:19:59 +02:00
parent ee3491a243
commit 1cea1d46e0
1 changed files with 9 additions and 5 deletions

View File

@ -4,19 +4,23 @@ import java.util.ArrayList;
public class Board {
private Piece[][] board;
private int width;
private int height;
public Board(int colNum, int lineNum) {
this.board = new Piece[8][8]; // 8x8 chess board
this.width = colNum; // col move x
this.height = lineNum; // line mov in y
this.board = new Piece[width][height]; // 8x8 chess board
}
public int getWidth() {
//TODO
return 0;
width = 8; // 8 for the moment can be changed
return width;
}
public int getHeight() {
//TODO
return 0;
height = 8; // 8 for the moment can be changed
return height;
}
public int getTurnNumber() {