Commit 16fd013e authored by Jeremy Whiting's avatar Jeremy Whiting
Browse files

When checking typed letters also check stripping accents.

In case user types a letter without accent but there aren't any
of that letter with accent also check un accented characters.
parent 18f5de5b
......@@ -462,6 +462,7 @@ void KanagramGame::resetAnagram()
void KanagramGame::moveLetter(const QString &letter)
{
QString small = letter.toLower();
QString strippedAnagram = stripAccents(m_anagram);
int index = m_anagram.toLower().indexOf(small);
if (index != -1)
{
......@@ -469,9 +470,28 @@ void KanagramGame::moveLetter(const QString &letter)
}
else
{
index = m_userAnswer.toLower().indexOf(letter);
index = strippedAnagram.toLower().indexOf(small);
if (index != -1)
moveLetterToAnagram(index);
{
moveLetterToUserAnswer(index);
}
else
{
QString strippedAnswer = stripAccents(m_userAnswer);
index = m_userAnswer.toLower().indexOf(small);
if (index != -1)
{
moveLetterToAnagram(index);
}
else
{
index = strippedAnswer.toLower().indexOf(small);
if (index != -1)
{
moveLetterToAnagram(index);
}
}
}
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment