MCPcopy Index your code
hub / github.com/careercup/ctci / initialize

Method initialize

java/Chapter 8/Question8_8/Board.java:12–25  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

10 }
11
12 public void initialize() {
13 /* initial board has a grid like the following in the center:
14 * WB
15 * BW
16 */
17 int middleRow = board.length / 2;
18 int middleColumn = board[middleRow].length / 2;
19 board[middleRow][middleColumn] = new Piece(Color.White);
20 board[middleRow + 1][middleColumn] = new Piece(Color.Black);
21 board[middleRow + 1][middleColumn + 1] = new Piece(Color.White);
22 board[middleRow][middleColumn + 1] = new Piece(Color.Black);
23 blackCount = 2;
24 whiteCount = 2;
25 }
26
27 public boolean placeColor(int row, int column, Color color) {
28 if (board[row][column] != null) {

Callers 2

mainMethod · 0.45
GameMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected