public class TicTacToe
extends java.lang.Object
| Constructor and Description |
|---|
TicTacToe() |
| Modifier and Type | Method and Description |
|---|---|
int |
getWinner()
Tells you who won the game.
|
int |
hashCode()
Returns a hashcode for this object.
|
boolean |
isOver()
Test if the game is over
|
boolean |
move(int row,
int col)
Makes a move in the given cell if it is empty (returns false if this is not possible).
|
int |
playerAt(int row,
int col)
Returns the current move made at the given location
|
java.lang.String |
toString()
String representation of this object.
|
public boolean move(int row,
int col)
row - The row of the movecol - The column of the movepublic int getWinner()
public boolean isOver()
public int playerAt(int row,
int col)
row - The rowcol - The columnpublic java.lang.String toString()
toString in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Object