using System;

public class Board
{
    private BoardSquare[][] _square= new BoardSquare[10][];

    public Board()
    {
        int index = 0;
        for (int x = 0; x < _square.Length; x++)
        {
            _square[x] = new BoardSquare[10];
            for (int y = 0; y < _square[x].Length; y++)
            {
                _square[x][y] = new BoardSquare(index);
                index++;
            }
        }
        
        _square[0][0].setOneMoveSquares(new BoardSquare[] { _square[0][1], _square[1][0] });
        _square[0][1].setOneMoveSquares(new BoardSquare[] { _square[0][0], _square[0][2], _square[1][1] });
        _square[0][2].setOneMoveSquares(new BoardSquare[] { _square[0][1], _square[0][3], _square[1][2] });
        _square[0][3].setOneMoveSquares(new BoardSquare[] { _square[0][2], _square[0][4], _square[1][3] });
        _square[0][4].setOneMoveSquares(new BoardSquare[] { _square[0][3], _square[0][5], _square[1][4] });
        _square[0][5].setOneMoveSquares(new BoardSquare[] { _square[0][4], _square[0][6], _square[1][5] });
        _square[0][6].setOneMoveSquares(new BoardSquare[] { _square[0][5], _square[0][7], _square[1][6] });
        _square[0][7].setOneMoveSquares(new BoardSquare[] { _square[0][6], _square[0][8], _square[1][7] });
        _square[0][8].setOneMoveSquares(new BoardSquare[] { _square[0][7], _square[0][9], _square[1][8] });
        _square[0][9].setOneMoveSquares(new BoardSquare[] { _square[0][8], _square[1][9] });
        _square[1][0].setOneMoveSquares(new BoardSquare[] { _square[0][0], _square[1][1], _square[2][0] });
        _square[1][1].setOneMoveSquares(new BoardSquare[] { _square[1][0], _square[0][1], _square[1][2], _square[2][1] });
        _square[1][2].setOneMoveSquares(new BoardSquare[] { _square[1][1], _square[0][2], _square[1][3], _square[2][2] });
        _square[1][3].setOneMoveSquares(new BoardSquare[] { _square[1][2], _square[0][3], _square[1][4], _square[2][3] });
        _square[1][4].setOneMoveSquares(new BoardSquare[] { _square[1][3], _square[0][4], _square[1][5], _square[2][4] });
        _square[1][5].setOneMoveSquares(new BoardSquare[] { _square[1][4], _square[0][5], _square[1][6], _square[2][5] });
        _square[1][6].setOneMoveSquares(new BoardSquare[] { _square[1][5], _square[0][6], _square[1][7], _square[2][6] });
        _square[1][7].setOneMoveSquares(new BoardSquare[] { _square[1][6], _square[0][7], _square[1][8], _square[2][7] });
        _square[1][8].setOneMoveSquares(new BoardSquare[] { _square[1][7], _square[0][8], _square[1][9], _square[2][8] });
        _square[1][9].setOneMoveSquares(new BoardSquare[] { _square[1][8], _square[0][9], _square[2][9] });
        _square[2][0].setOneMoveSquares(new BoardSquare[] { _square[1][0], _square[2][1], _square[3][0] });
        _square[2][1].setOneMoveSquares(new BoardSquare[] { _square[2][0], _square[1][1], _square[2][2], _square[3][1] });
        _square[2][2].setOneMoveSquares(new BoardSquare[] { _square[2][1], _square[1][2], _square[2][3], _square[3][2] });
        _square[2][3].setOneMoveSquares(new BoardSquare[] { _square[2][2], _square[1][3], _square[2][4], _square[3][3] });
        _square[2][4].setOneMoveSquares(new BoardSquare[] { _square[2][3], _square[1][4], _square[2][5], _square[3][4] });
        _square[2][5].setOneMoveSquares(new BoardSquare[] { _square[2][4], _square[1][5], _square[2][6], _square[3][5] });
        _square[2][6].setOneMoveSquares(new BoardSquare[] { _square[2][5], _square[1][6], _square[2][7], _square[3][6] });
        _square[2][7].setOneMoveSquares(new BoardSquare[] { _square[2][6], _square[1][7], _square[2][8], _square[3][7] });
        _square[2][8].setOneMoveSquares(new BoardSquare[] { _square[2][7], _square[1][8], _square[2][9], _square[3][8] });
        _square[2][9].setOneMoveSquares(new BoardSquare[] { _square[2][8], _square[1][9], _square[3][9] });
        _square[3][0].setOneMoveSquares(new BoardSquare[] { _square[2][0], _square[3][1], _square[4][0] });
        _square[3][1].setOneMoveSquares(new BoardSquare[] { _square[3][0], _square[2][1], _square[3][2], _square[4][1] });
        _square[3][2].setOneMoveSquares(new BoardSquare[] { _square[3][1], _square[2][2], _square[3][3] });
        _square[3][3].setOneMoveSquares(new BoardSquare[] { _square[3][2], _square[2][3], _square[3][4] });
        _square[3][4].setOneMoveSquares(new BoardSquare[] { _square[3][3], _square[2][4], _square[3][5], _square[4][4] });
        _square[3][5].setOneMoveSquares(new BoardSquare[] { _square[3][4], _square[2][5], _square[3][6], _square[4][5] });
        _square[3][6].setOneMoveSquares(new BoardSquare[] { _square[3][5], _square[2][6], _square[3][7] });
        _square[3][7].setOneMoveSquares(new BoardSquare[] { _square[3][6], _square[2][7], _square[3][8] });
        _square[3][8].setOneMoveSquares(new BoardSquare[] { _square[3][7], _square[2][8], _square[3][9], _square[4][8] });
        _square[3][9].setOneMoveSquares(new BoardSquare[] { _square[3][8], _square[2][9], _square[4][9] });
        _square[4][0].setOneMoveSquares(new BoardSquare[] { _square[3][0], _square[4][1], _square[5][0] });
        _square[4][1].setOneMoveSquares(new BoardSquare[] { _square[4][0], _square[3][1], _square[5][1] });
        _square[4][2].setOneMoveSquares(new BoardSquare[0]);
        _square[4][3].setOneMoveSquares(new BoardSquare[0]);
        _square[4][4].setOneMoveSquares(new BoardSquare[] { _square[3][4], _square[4][5], _square[5][4] });
        _square[4][5].setOneMoveSquares(new BoardSquare[] { _square[4][4], _square[3][5], _square[5][5] });
        _square[4][6].setOneMoveSquares(new BoardSquare[0]);
        _square[4][7].setOneMoveSquares(new BoardSquare[0]);
        _square[4][8].setOneMoveSquares(new BoardSquare[] { _square[3][8], _square[4][9], _square[5][8] });
        _square[4][9].setOneMoveSquares(new BoardSquare[] { _square[4][8], _square[3][9], _square[5][9] });
        _square[5][0].setOneMoveSquares(new BoardSquare[] { _square[4][0], _square[5][1], _square[6][0] });
        _square[5][1].setOneMoveSquares(new BoardSquare[] { _square[5][0], _square[4][1], _square[6][1] });
        _square[5][2].setOneMoveSquares(new BoardSquare[0]);
        _square[5][3].setOneMoveSquares(new BoardSquare[0]);
        _square[5][4].setOneMoveSquares(new BoardSquare[] { _square[4][4], _square[5][5], _square[6][4] });
        _square[5][5].setOneMoveSquares(new BoardSquare[] { _square[5][4], _square[4][5], _square[6][5] });
        _square[5][6].setOneMoveSquares(new BoardSquare[0]);
        _square[5][7].setOneMoveSquares(new BoardSquare[0]);
        _square[5][8].setOneMoveSquares(new BoardSquare[] { _square[4][8], _square[5][9], _square[6][8] });
        _square[5][9].setOneMoveSquares(new BoardSquare[] { _square[5][8], _square[4][9], _square[6][9] });
        _square[6][0].setOneMoveSquares(new BoardSquare[] { _square[5][0], _square[6][1], _square[7][0] });
        _square[6][1].setOneMoveSquares(new BoardSquare[] { _square[6][0], _square[5][1], _square[6][2], _square[7][1] });
        _square[6][2].setOneMoveSquares(new BoardSquare[] { _square[6][1], _square[7][2], _square[6][3] });
        _square[6][3].setOneMoveSquares(new BoardSquare[] { _square[6][2], _square[7][3], _square[6][4] });
        _square[6][4].setOneMoveSquares(new BoardSquare[] { _square[6][3], _square[5][4], _square[6][5], _square[7][4] });
        _square[6][5].setOneMoveSquares(new BoardSquare[] { _square[6][4], _square[5][5], _square[7][5], _square[6][6] });
        _square[6][6].setOneMoveSquares(new BoardSquare[] { _square[6][5], _square[7][6], _square[6][7] });
        _square[6][7].setOneMoveSquares(new BoardSquare[] { _square[6][6], _square[6][8], _square[7][7] });
        _square[6][8].setOneMoveSquares(new BoardSquare[] { _square[6][7], _square[5][8], _square[6][9], _square[7][8] });
        _square[6][9].setOneMoveSquares(new BoardSquare[] { _square[6][8], _square[5][9], _square[7][9] });
        _square[7][0].setOneMoveSquares(new BoardSquare[] { _square[6][0], _square[7][1], _square[8][0] });
        _square[7][1].setOneMoveSquares(new BoardSquare[] { _square[7][0], _square[6][1], _square[7][2], _square[8][1] });
        _square[7][2].setOneMoveSquares(new BoardSquare[] { _square[7][1], _square[6][2], _square[7][3], _square[8][2] });
        _square[7][3].setOneMoveSquares(new BoardSquare[] { _square[7][2], _square[6][3], _square[7][4], _square[8][3] });
        _square[7][4].setOneMoveSquares(new BoardSquare[] { _square[7][3], _square[6][4], _square[7][5], _square[8][4] });
        _square[7][5].setOneMoveSquares(new BoardSquare[] { _square[7][4], _square[6][5], _square[7][6], _square[8][5] });
        _square[7][6].setOneMoveSquares(new BoardSquare[] { _square[7][5], _square[6][6], _square[7][7], _square[8][6] });
        _square[7][7].setOneMoveSquares(new BoardSquare[] { _square[7][6], _square[6][7], _square[7][8], _square[8][7] });
        _square[7][8].setOneMoveSquares(new BoardSquare[] { _square[7][7], _square[6][8], _square[7][9], _square[8][8] });
        _square[7][9].setOneMoveSquares(new BoardSquare[] { _square[7][8], _square[6][9], _square[8][9] });
        _square[8][0].setOneMoveSquares(new BoardSquare[] { _square[7][0], _square[8][1], _square[9][0] });
        _square[8][1].setOneMoveSquares(new BoardSquare[] { _square[8][0], _square[7][1], _square[8][2], _square[9][1] });
        _square[8][2].setOneMoveSquares(new BoardSquare[] { _square[8][1], _square[7][2], _square[8][3], _square[9][2] });
        _square[8][3].setOneMoveSquares(new BoardSquare[] { _square[8][2], _square[7][3], _square[8][4], _square[9][3] });
        _square[8][4].setOneMoveSquares(new BoardSquare[] { _square[8][3], _square[7][4], _square[8][5], _square[9][4] });
        _square[8][5].setOneMoveSquares(new BoardSquare[] { _square[8][4], _square[7][5], _square[8][6], _square[9][5] });
        _square[8][6].setOneMoveSquares(new BoardSquare[] { _square[8][5], _square[7][6], _square[8][7], _square[9][6] });
        _square[8][7].setOneMoveSquares(new BoardSquare[] { _square[8][6], _square[7][7], _square[8][8], _square[9][7] });
        _square[8][8].setOneMoveSquares(new BoardSquare[] { _square[8][7], _square[7][8], _square[8][9], _square[9][8] });
        _square[8][9].setOneMoveSquares(new BoardSquare[] { _square[8][8], _square[7][9], _square[9][9] });
        _square[9][0].setOneMoveSquares(new BoardSquare[] { _square[9][1], _square[8][0] });
        _square[9][1].setOneMoveSquares(new BoardSquare[] { _square[9][0], _square[9][2], _square[8][1] });
        _square[9][2].setOneMoveSquares(new BoardSquare[] { _square[9][1], _square[9][3], _square[8][2] });
        _square[9][3].setOneMoveSquares(new BoardSquare[] { _square[9][2], _square[9][4], _square[8][3] });
        _square[9][4].setOneMoveSquares(new BoardSquare[] { _square[9][3], _square[9][5], _square[8][4] });
        _square[9][5].setOneMoveSquares(new BoardSquare[] { _square[9][4], _square[9][6], _square[8][5] });
        _square[9][6].setOneMoveSquares(new BoardSquare[] { _square[9][5], _square[9][7], _square[8][6] });
        _square[9][7].setOneMoveSquares(new BoardSquare[] { _square[9][6], _square[9][8], _square[8][7] });
        _square[9][8].setOneMoveSquares(new BoardSquare[] { _square[9][7], _square[9][9], _square[8][8] });
        _square[9][9].setOneMoveSquares(new BoardSquare[] { _square[9][8], _square[8][9] });
    }

    public BoardSquare[][] getBoardSquares()
    {
        return _square;
    }
}