我的tic-tac-toe程序遇到了一个小问题,这是创建单元格的代码。我正在使用ACM库,因此不需要System.out
。
import acm.program.*;
public class Cell {
Cell_content content;
int row;
int col;
// Constructor to make an empty cell
public Cell(int row, int col) {
this.row = row;
this.col = col;
content = Cell_content.EMPTY;
}
//Content to print inside the cell
public void cellPrint() {
switch (content) {
case CROSS: print(" X "); break;
case NOUGHT: print(" O "); break;
case EMPTY: print(" "); break;
}
}
}