I seem to be struggling with the concept of for loops and how, in this lecture, it did what it did.
Could someone try to take a crack at explaining for loops and how it helped us fix the bug in our CYOA game? I didn’t get Rick’s explanation and when I asked the teaching assistant in Udemy, their explanation didn’t clear things up either.
I understand the different elements and the syntax of the for loop: it declares and initializes a variable, it establishes conditions, if the condition is true it executes the code block then increases by one and cycles around again until the condition is no longer being met and essentially terminates the loop. But that’s the extent of my understanding. I don’t see how the loop we made allowed us to influence key commands and fix the bug and such.
Maybe I’m trying to understand more than I’m expected to at this time, but I’m afraid if I continue with the course without fully understanding this lecture, I’ll be setting myself up for further confusion…
Thank you in advance to anyone that can perhaps explain this concept in a way my brain might be able to internalize!