If else statements help please

for(int32 i = 0; i < HiddenWordLength; i++){
//compare ltters against hidden word
for(int j = 0; j < HiddenWordLength; j++){
//if they match
//if in correct place
//increment bulls
if((Guess[i] == MyHiddenWord[j]) && (i == j)){
//increment cows
else if(Guess[i] == MyHiddenWord[j]){


I have coded my statements in the challenge as above. I tested if the the letter and the subscript i from first loop matched the letter and subscript from second loop it was a bull. if the letter matched but i and j did not it was a cow.
It seems to work fine?

Privacy & Terms