Hello Forum,
I’m very much struggling to understand all of the tools we’re using and how they interact at this stage. I was wondering if someone out there could kindly hold my hand through the following chunk of code and explain to me in simple terms what it’s doing and how it’s doing it.
I don’t understand what a “handle” does exactly (ie “(FString Word)”). Is it just a way for another function to retrieve information from this function? If that’s the case then isn’t that what the return type, “bool” and “return true” line is for? Wouldn’t one just use the name of function to retrieve this information rather than a handle?
“TMap<char, bool> LetterSeen;” is essentially creating a boolean named “LetterSeen”, yes? Because it comes from a map, this boolean will change which is why we’ll be looping through it?
I still don’t really understand what “auto” does or what its purpose is. How high of a level is “char”? Is it a type of variable similar in broadness to a bool or a void? Where else might one use “auto”?
I don’t understand how the line “for (auto Letter : Word)” translates to “For all letters of the word” as Ben says. I think I really need this explained to me.
Next, where does “tolower” come from? We didn’t define it anywhere did we? So is it some sort of method that’s defined in something we’ve imported? Is it similar to how we sometimes use “.length” to measure strings? What does “letter” in parentheses mean in this line? Sometimes I don’t grasp what it means when you have a word in parentheses like back in “Main.cpp” where early on it says “while(bPlayAgain);” I find it difficult to translate that into English.
The square brackets in this example are getting a value called “Letter” from the map we’ve created, right? What’s it doing with that value?
The more someone could break this down for me, the more I think I’ll understand it. A couple lessons ago I felt like I had a strong grasp on all of the concepts, but now I feel lost.
Thank you so much for your advice and patience!