I’m infuriated at the authors of this course. I still can’t fix this error even with the solutions given here. One of the solutions that averts the error disrupts the functionality of the game.
The authors are off making other courses that they can sell and apparently are fine completely abandoning their students and not providing an answer to this that is clear and correct. If I don’t get an appropriate answer to this question by the time I finish this course I’m giving it negative stars if possible. Shame on the people who made this for putting the burden on their students and not looking into this and offering the solution.
Thanks for the note. I reverted back to the course code after your snippet wasn’t working, so here it is as it stands now:
FBullCowCount FBullCowGame::SubmitGuess(FString Guess)
{
// incriment the turn number
MyCurrentTry++;
// setup a return variable
FBullCowCount BullCowCount;
// 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 then
if (Guess[GChar] == MyHiddenWord[MHWChar]) {
if (MHWChar == GChar) { // if they're in the same place
BullCowCount.Bulls++; // incriment bulls
}
else {
BullCowCount.Cows++; // must be a cow
}
}
}
}
return BullCowCount;
}
I think it’s worth mentioning for anyone else that may be thinking about taking lessons with these people that I actually needed to spell-correct this code even though I took it directly from the lesson snippet on Github. Just one of numerous, numerous mispellings and mistakes which litter the slides and code from what is turning out to be the sloppiest and worst course on Udemy I have ever taken. Length was spelled incorrectly for probably the tenth time since I’ve started the course - the supposedly native english speakers who give it cannot spell the words “Increment”, “Hidden”, “Length” and various other words that any 10 year old of average intelligence can spell and type.
That being said - using the code above crashes in the same manner when I attempt to type in a three letter word.
I’d appreciate any help that can be offered, but I’d appreciate even more an explanation from the authors on why they have offered no solution for this and why they are still silent on this thread that is over twenty posts long, and then offer an answer that actually works.
James_C,
The code snippet I posted here works just fine. It didn’t work for you because you had NOT copied it correctly (referring to your stackoverflow post)