All Questions

Community

B
Bo Jordan(Boeo2958)

Placing Gems On A Grid Practice

Hey there!

Struggled to pass this one for about a half hour, even though the solution was technically right from the beginning. After completing the code for the "generate_gems" function, I noticed it hadn't actually been called anywhere in the code, so I expected to have to add it myself, but doing so generated two grids on top of one another and caused the practice to fail.

I couldn't figure out what I was doing wrong for the life of me until I realized the function must be automatically called once somewhere behind the scenes at run-time. If memory serves, the default code in most of the other practices visibly calls the functions we're supposed to complete somewhere, so it never crossed my mind that I would need to call them myself, but those calls are missing on this and the last practice as well. I had added a call on the previous practice as well, but that one passes whether you do so or not so I didn't notice. This one really threw me off lol.

Just for reference, this is what I expected the code needed to be, but it fails unless you remove the "_ready" call I added:

Just something I thought I should bring up, might be a frustration for someone else in the future. =)

Using the 0.8.1 practices.

  • Nathan Lovato replied

    Would you have liked an explicit mention that we'll call the function ourselves?

    In general, we mention it in the instructions if you need to call a function or what you need to complete.

    Having other scripts call a function of your script is something that happens all the time, so even if you don't see a function called in a given script, it doesn't mean that it doesn't get called.

  • B
    Bo Jordan(Boeo2958) replied

    I'm still wrapping my head around how a lot of these things work and how they play together, so I think my noobie brain saw something missing that was usually always there and was like "oh, I know how to do this!" and wanted to fix it lol.

    I do know that there's a lot going on in the background with the practices, just wasn't expecting it, and could maybe see someone else making the same mistake is all. =)

  • Nathan Lovato replied

    Sure, thanks for sharing. It's both useful for others, and explaining your experience is very useful for us to improve the course too. We take it into account not only to improve specific bits of the course but also when making new lessons and practices.