Modifier and Type | Field and Description |
---|---|
private char[][] |
board |
private char |
currentPlayerMark |
Constructor and Description |
---|
TicTacToe() |
Modifier and Type | Method and Description |
---|---|
private void |
changePlayer() |
private boolean |
checkColumnsForWin() |
private boolean |
checkDiagonalsForWin() |
private boolean |
checkRowCol(char c1,
char c2,
char c3) |
private boolean |
checkRowsForWin() |
void |
initializeBoard() |
boolean |
isBoardFull() |
boolean |
isWinner() |
static void |
main(String[] args)
Toms Main method to show how to use this class in a simple console app.
|
boolean |
placeMark(int row,
int col) |
void |
printBoard() |
private char[][] board
private char currentPlayerMark
public TicTacToe()
public void initializeBoard()
public void printBoard()
public boolean isBoardFull()
public boolean isWinner()
private boolean checkRowsForWin()
private boolean checkColumnsForWin()
private boolean checkDiagonalsForWin()
private boolean checkRowCol(char c1, char c2, char c3)
private void changePlayer()
public boolean placeMark(int row, int col)
WebARTS Library Licensed Under the GNU - General Public License. Other Libraries licensed under their respective Open Source Licenses