Ben I couldn’t understand how this is working… :~/ Please help me out…
explain me about the [ ] too…
//loop through all letters in the guess
int32 HiddenWordLength = MyHiddenWord.length();
for (int32 MHWChar = 0; MHWChar < HiddenWordLength; MHWChar++)
{
// compare letters against the hidden word
for (int32 GChar = 0; GChar < HiddenWordLength; GChar++)
{
// if they match
if (Guess[GChar] == MyHiddenWord[MHWChar])
{
if (MHWChar == GChar)
{
BullCowCount.Bulls++; // increment bulls
}
else
{
BullCowCount.Cows++; // increment cows
}
}
}
}
return BullCowCount;
}