added turn method

This commit is contained in:
Jérôme BEDIER 2025-04-18 15:46:24 +02:00
parent 1cea1d46e0
commit fb42b33ab7
1 changed files with 8 additions and 2 deletions

View File

@ -6,6 +6,8 @@ public class Board {
private Piece[][] board; private Piece[][] board;
private int width; private int width;
private int height; private int height;
private int turn;
private int n;
public Board(int colNum, int lineNum) { public Board(int colNum, int lineNum) {
this.width = colNum; // col move x this.width = colNum; // col move x
@ -24,8 +26,12 @@ public class Board {
} }
public int getTurnNumber() { public int getTurnNumber() {
//TODO turn = 1;
return 0; for (int i = 1; i<=n; i++) {
if (n%i == 0) {
turn += 1;
}}
return turn;
} }
public boolean isTurnWhite() { public boolean isTurnWhite() {