@@ -0,0 +1,2173 @@
+class TicTacToe %7B%0A    %0A    private int%5B%5D%5B%5D board;%0A    %0A    /** Initialize your data structure here. */%0A    public TicTacToe(int n) %7B%0A        board = new int%5Bn%5D%5Bn%5D;%0A    %7D%0A    %0A    /** Player %7Bplayer%7D makes a move at (%7Brow%7D, %7Bcol%7D).%0A        @param row The row of the board.%0A        @param col The column of the board.%0A        @param player The player, can be either 1 or 2.%0A        @return The current winning condition, can be either:%0A                0: No one wins.%0A                1: Player 1 wins.%0A                2: Player 2 wins. */%0A    public int move(int row, int col, int player) %7B%0A        board%5Brow%5D%5Bcol%5D = player;%0A        %0A        if (isRowWin(row, col, player) %7C%7C isColWin(row, col, player) %7C%7C isDiagnalWin(row, col, player) %7C%7C isReverseDiagnalWin(row, col, player)) %7B%0A            return player;%0A        %7D%0A        %0A        return 0;%0A    %7D%0A    %0A    private boolean isRowWin(int row, int col, int player) %7B%0A        for (int i = 0; i %3C board.length; i++) %7B%0A            if (board%5Bi%5D%5Bcol%5D != player) %7B%0A                return false;%0A            %7D%0A        %7D%0A        %0A        return true;%0A    %7D%0A    %0A    private boolean isColWin(int row, int col, int player) %7B%0A        for (int i = 0; i %3C board.length; i++) %7B%0A            if (board%5Brow%5D%5Bi%5D != player) %7B%0A                return false;%0A            %7D%0A        %7D%0A        %0A        return true;%0A    %7D%0A    %0A    private boolean isDiagnalWin(int row, int col, int player) %7B%0A        if (row != col) %7B%0A            return false;%0A        %7D%0A        %0A        for (int i = 0; i %3C board.length; i++) %7B%0A            if (board%5Bi%5D%5Bi%5D != player) %7B%0A                return false;%0A            %7D%0A        %7D%0A%0A        return true;%0A    %7D%0A    %0A    private boolean isReverseDiagnalWin(int row, int col, int player) %7B%0A        if (row + col != board.length - 1) %7B%0A            return false;%0A        %7D%0A        %0A        for (int i = 0; i %3C board.length; i++) %7B%0A            if (board%5Bi%5D%5Bboard.length - i - 1%5D != player) %7B%0A                return false;%0A            %7D%0A        %7D%0A%0A        return true;%0A    %7D%0A%7D%0A%0A/**%0A * Your TicTacToe object will be instantiated and called as such:%0A * TicTacToe obj = new TicTacToe(n);%0A * int param_1 = obj.move(row,col,player);%0A */%0A

Create DesignTicTacToe.java