forked from 1nn0vatrix/Project_Account
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathChessBoard.java
More file actions
84 lines (79 loc) · 2.2 KB
/
ChessBoard.java
File metadata and controls
84 lines (79 loc) · 2.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
public class ChessBoard {
private ChessPiece[][] board = new ChessPiece[8][8];
public ChessBoard() {
board[0][0] = new Rook(Color.black);
board[0][1] = new Knight(Color.black);
board[0][2] = new Bishop(Color.black);
board[0][3] = new Queen(Color.black);
board[0][4] = new King(Color.black);
board[0][5] = new Bishop(Color.black);
board[0][6] = new Knight(Color.black);
board[0][7] = new Rook(Color.black);
board[1][0] = new Pawn(Color.black);
board[1][1] = new Pawn(Color.black);
board[1][2] = new Pawn(Color.black);
board[1][3] = new Pawn(Color.black);
board[1][4] = new Pawn(Color.black);
board[1][5] = new Pawn(Color.black);
board[1][6] = new Pawn(Color.black);
board[1][7] = new Pawn(Color.black);
board[2][0] = null;
board[2][1] = null;
board[2][2] = null;
board[2][3] = null;
board[2][4] = null;
board[2][5] = null;
board[2][6] = null;
board[2][7] = null;
board[3][0] = null;
board[3][1] = null;
board[3][2] = null;
board[3][3] = null;
board[3][4] = null;
board[3][5] = null;
board[3][6] = null;
board[3][7] = null;
board[4][0] = null;
board[4][1] = null;
board[4][2] = null;
board[4][3] = null;
board[4][4] = null;
board[4][5] = null;
board[4][6] = null;
board[4][7] = null;
board[5][0] = null;
board[5][1] = null;
board[5][2] = null;
board[5][3] = null;
board[5][4] = null;
board[5][5] = null;
board[5][6] = null;
board[5][7] = null;
board[6][0] = new Pawn(Color.white);
board[6][1] = new Pawn(Color.white);
board[6][2] = new Pawn(Color.white);
board[6][3] = new Pawn(Color.white);
board[6][4] = new Pawn(Color.white);
board[6][5] = new Pawn(Color.white);
board[6][6] = new Pawn(Color.white);
board[6][7] = new Pawn(Color.white);
board[7][0] = new Rook(Color.white);
board[7][1] = new Knight(Color.white);
board[7][2] = new Bishop(Color.white);
board[7][3] = new Queen(Color.white);
board[7][4] = new King(Color.white);
board[7][5] = new Bishop(Color.white);
board[7][6] = new Knight(Color.white);
board[7][7] = new Rook(Color.white);
}
public String printBoard()
{
for(int i = 0; i<ChessBoard.length; i++)
{
System.out.println("| ");
for(int j = 0 ; j<ChessBoard.length; j++)
{
}
}
}
}