///Saves the word static void SaveWord(char[,] arr, WordPlace place, string word) { for (int i = 0; i < word.Length; i++) { arr[place.x + (place.isRightDirection ? 0 : i), place.y + (place.isRightDirection ? i : 0)] = word[i]; } }
///Checks if we can save the word static bool CheckWord(char[,] arr, WordPlace place, string word) { var res = true; for (int i = 0; i < word.Length; i++) { char letter = arr[place.x + (place.isRightDirection ? 0 : i), place.y + (place.isRightDirection ? i : 0)]; if (letter != '-' && letter != word[i]) { res = false; } } return(res); }