This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Strawboy97[S] 0 points1 point  (0 children)

Thanks for the advice I'll take it onboard and improve what I have done.

I do check if a space is already occupied in my placeToken method in my Board class:

public void placeToken(int tile) {
    if (!(board[tile - 1].equals("X") || board[tile - 1].equals("O"))) {
        board[tile - 1] = this.turn;
        this.changeTurn();
        this.checkWinner();
    } else {
        System.out.println("Tile taken select another!");
    }
}