package com.packtpublishing.tddjava.ch03tictactoe;

public class TicTacToe {

    private Character[][] board = {{null, null, null}, {null, null, null}, {null, null, null}};

    public void play(int x, int y) {
        if (x < 1 || x > 3) {
            throw new RuntimeException("Wartość X wykracza poza planszę");
        } else if (y < 1 || y > 3) {
            throw new RuntimeException("Wartość Y wykracza poza planszę");
        }
        if (board[x - 1][y - 1] != null) {
            throw new RuntimeException("Pole jest już zajęte");
        } else {
            board[x - 1][y - 1] = 'X';
        }
    }

}
