Ejemplo n.º 1
0
        public bool ValidateRow(Board board, bool isvert, int row)
        {
            char   current;
            string str = "";

            for (int i = 0; i < board.GetBoardSize(); ++i)
            {
                if (isvert)
                {
                    current = board.GetBoard() [row] [i];
                }
                else
                {
                    current = board.GetBoard() [i] [row];
                }
                if (current == '#')
                {
                    if (str.Length > 1)
                    {
                        if (ValidateWord(str) == false)
                        {
                            return(false);
                        }
                    }
                    str = "";
                }
                else
                {
                    str += current;
                }
            }
            if (str.Length > 1)
            {
                if (ValidateWord(str) == false)
                {
                    return(false);
                }
            }
            return(true);
        }
Ejemplo n.º 2
0
		public bool ValidateRow(Board board, bool isvert, int row)
		{
			char current;
			string str = "";
			for (int i = 0; i < board.GetBoardSize(); ++i)
			{
				if (isvert) 
				{
					current = board.GetBoard() [row] [i];
				} 
				else 
				{
					current = board.GetBoard() [i] [row];
				}
				if (current == '#')
				{
					if (str.Length > 1)
					{
						if (ValidateWord (str) == false)
						{
							return false;
						}
					}
					str = "";
				}
				else
				{
					str += current;
				}
			}
			if (str.Length > 1)
			{
				if (ValidateWord (str) == false)
				{
					return false;
				}
			}
			return true;
		}
Ejemplo n.º 3
0
 public char[][] GetBoard()
 {
     return(board.GetBoard());
 }