added turn method
This commit is contained in:
parent
1cea1d46e0
commit
fb42b33ab7
|
|
@ -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() {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue