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); }
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; }
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); }
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; }