public int IndexOf(CrozzleWord value) { return sortedByScore.IndexOf(value); }
public bool Remove(CrozzleWord value) { return sortedByScore.Remove(value); }
public static int GetScore(Crozzle crozz, Wordlist wordl) { CrozzleToValidate = crozz; WordlistToValidate = wordl; int runningTotal = 0; if (WordlistToValidate.Difficulty != "EXTREME") { for (int y = 0; y < CrozzleToValidate.Height; y++) { for (int x = 0; x < CrozzleToValidate.Width; x++) { char currentChar = CrozzleToValidate[x, y]; if (isLetter(currentChar)) runningTotal += getLetterScore(currentChar); } } if (WordlistToValidate.Difficulty == "HARD") { runningTotal += (CrozzleToValidate.Words.Count * 10); } } else { foreach (string wordH in CrozzleToValidate.HorizontalWords) { CrozzleWord cwH = new CrozzleWord(wordH, CrozzleToValidate.Words[wordH]); foreach (CrozzleWord cwV in CrozzleToValidate.IntersectedWords[wordH]) { int foundX = -1; for (int i = cwH.X; i < cwH.X + cwH.Length; i++) { if (i == cwV.X) { foundX = i; break; } } int foundY = -1; for (int j = cwV.Y; j < cwV.Y + cwV.Length; j++) { if (j == cwH.Y) { foundY = j; break; } } if (foundX >= 0 && foundY >= 0) { runningTotal += getLetterScore(CrozzleToValidate[foundX, foundY]); } } } runningTotal += (CrozzleToValidate.Words.Count * 10); } return runningTotal; }