Esempio n. 1
0
        // Print board to console
        public void DebugWriteLineBoard(BoardTemplate <char> board)
        {
            Debug.WriteLine("    0 1 2 3 4 5 6 7 8 9 1 2\n");
            for (var i = 0; i < board.Layout.GetLength(0); i++)
            {
                //var rowString = new string(_board[i]);

                var rowString = String.Empty;

                for (var j = 0; j < board.Layout.GetLength(1); j++)
                {
                    rowString += board.Layout[i, j] + " ";
                }

                var rowCount = "";

                if (i < 10)
                {
                    rowCount = "0" + i.ToString();
                }
                else
                {
                    rowCount = i.ToString();
                }
                Debug.WriteLine(rowCount + "   " + rowString);
            }
        }
Esempio n. 2
0
        public void InitializeBoard(int width, int height, char emptyChar)
        {
            Board = new BoardTemplate <char>(height, width, emptyChar);          // Array 1 is Row, Array 2 is Column
            CrossWordBoardCheck = new BoardTemplate <char>(height, width, '\0'); // Array 1 is Row, Array 2 is Column

            Width      = Board.Width;
            Height     = Board.Height;
            _emptyChar = Board.EmptyChar;
        }
 public void InitializeBoard(int width, int height)
 {
     Board  = new BoardTemplate <PlacedWordGroup>(height, width, new PlacedWordGroup());
     Width  = width;
     Height = height;
 }