コード例 #1
0
ファイル: Rules.cs プロジェクト: HGrantt/Monodevelop
 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);
 }
コード例 #2
0
ファイル: Rules.cs プロジェクト: HGrantt/Monodevelop
		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;
		}
コード例 #3
0
ファイル: Rules.cs プロジェクト: HGrantt/Monodevelop
        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);
        }
コード例 #4
0
ファイル: Rules.cs プロジェクト: HGrantt/Monodevelop
		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;
		}