Why using myhiddenword lenght for going through the guess letter?

Why using myhiddenword lenght for going through the Guess string letter when we can use the Guess length itself ?

By the way

for (int32 i = 0; i < Guess.length(); i++)
	{		
		for (int32 j = 0; j < HiddenWordLenght; j++)
		{
			if (Guess[i] == MyHiddenWord[j])
			{
				if (i == j)
				{
					BCCount.Bulls++;
				}
				else
				{
					BCCount.Cows++;
				}
				break;
			}
		}
	}

this loop wouldn’t make the whole thing have the crash you had but i guess it was intended

I think, for safer purpose, we use the lenght of the hidden word because that value its certain that it’s not going to change in runtime.

Privacy & Terms