@@ -0,0 +1,1420 @@
+%0Apublic class ChessBoard %7B%0A    ChessFactory factory = new ChessFactory();%0A    static short NO_CHESS = -1;%0A    static short BLACK_CHESS = 0;%0A    static short WHITE_CHESS = 1;%0A%0A    private short boardStatus%5B%5D%5B%5D = new short%5B19%5D%5B19%5D;%0A    private short nowPlayer;%0A%0A    public ChessBoard()%7B%0A        // Clean Chess Board%0A        for(int i=0;i%3C19;i++)%7B%0A            for(int j=0;j%3C19;j++)%7B%0A                this.boardStatus%5Bi%5D%5Bj%5D = NO_CHESS;%0A            %7D%0A        %7D%0A%0A        // Black Chess First%0A        this.nowPlayer = BLACK_CHESS;%0A    %7D%0A%0A    public void clickDot(Location loc) throws HasChessException %7B%0A        if (this.getStatus(loc) != NO_CHESS)%7B%0A            throw new HasChessException(loc);%0A        %7D%0A%0A        if (this.checkFinish())%7B%0A%0A        %7D else %7B%0A            this.changePlayer();%0A        %7D%0A%0A    %7D%0A%0A    private short getStatus(Location loc)%7B%0A        return this.boardStatus%5Bloc.getX()%5D%5Bloc.getY()%5D;%0A    %7D%0A%0A    private boolean checkFinish()%7B%0A        // LOL%0A        // TODO: Finish Check%0A        return (int) (Math.random() * 10) %3E 5;%0A    %7D%0A%0A    private void changePlayer()%7B%0A        if (this.nowPlayer == BLACK_CHESS)%7B%0A            this.nowPlayer = WHITE_CHESS;%0A        %7D else %7B%0A            this.nowPlayer = BLACK_CHESS;%0A        %7D%0A    %7D%0A%7D%0A%0Aclass HasChessException extends Exception %7B%0A    public HasChessException(Location loc)%7B%0A        System.out.println(%22Error: There is already having a chess at %22 + loc + %22.%22);%0A    %7D%0A%7D

Add ChessBoard