Ejemplo n.º 1
0
        public void Test()
        {
            IBoard board = new Board(4, 12);

            byte[] cells = new byte[board.Width * board.Height];
            for (int i = 0; i < board.Height; i += 3)
            {
                cells[2 + i * board.Width] = 1;
            }
            board.SetCells(cells);

            DisplayBoard(board);

            Console.ReadLine();

            board.LeftGravity();
            DisplayBoard(board);

            int buriedHoles = BoardHelper.GetBuriedHolesForColumn(board, 1);
            int holeDepth   = BoardHelper.GetHoleDepthForColumn(board, 1);
            int allWells    = BoardHelper.GetAllWellsForColumn(board, 1);
            int blockades   = BoardHelper.GetBlockadesForColumn(board, 1);

            Console.WriteLine();
            Console.WriteLine("{0} {1} {2} {3}", buriedHoles, holeDepth, allWells, blockades);
        }