In the Bull Cow game I noticed that Word[Word.Len()] doesn’t return a placeholder as stated in the course it actually does return the last character and so if I had an Isogram and the word I entered was ‘test’ then it wasn’t getting detected by my logic because ’ i < Word.Len() - 1’ was stopping my loop after the ‘s’ and not the ‘t’. Is it possible I’m misunderstanding my own logic? Lol
for (int32 i = 0; i < Guess.Len() - 1; i++)
{
for (int j = 0; j < Guess.Len() - 1; j++)
{
if (Guess[i] == Guess[j] && i != j)
{
return true;
}
}
}
That code will not return true for the word test but if I remove the ‘- 1’ it does