February 7, 2017
CS112Assignment2

第一份文件:Board.Java
package hw2;

/**
* @author: ENTER YOUR FIRST AND LAST NAME HERE
* @email: ENTER YOUR BU EMAIL HERE
*/
public class Board {
// 0 means empty, 1 means X, 2 means O
public static final char[] sym = {‘ ‘, ‘X’, ‘O’};
private int[][] board;
private int height, width;
private int winLength;

public Board(int h, int w, int winLen) {
height = h;
width = w;
winLength = winLen;
board = new int[height][width];
// Java initializes new array elements to 0 automatically, so the board is empty
}

public int getWidth() {
return width;
}