Exemple #1
0
 public bool ValidateBoard(Board board)
 {
     for (int i = 0; i < board.GetBoardSize(); i++)
     {
         if (ValidateRow(board, true, i) == false || ValidateRow(board, false, i) == false)
         {
             return(false);
         }
     }
     return(true);
 }
Exemple #2
0
		public bool ValidateBoard(Board board)
		{
			for (int i = 0; i < board.GetBoardSize(); i++)
			{
				if (ValidateRow (board, true, i) == false || ValidateRow (board, false, i) == false)
				{
					return false;
				}
			}
			return true;
		}
Exemple #3
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);
        }
Exemple #4
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;
		}