Unit 6 Lesson 13 "Hackathon"

I have a student who is trying to use code from another app which already works, and adapt it to his own. However, the results are blank. Where is he going wrong? There are no discernible errors showing in the code, so is it a design issue or something else? We are stumped at the moment. Any help will be appreciated.
Here is the first attempt:

and here is the modified attempt:

@darrin.patterson I noticed two errors in the code. The first is that the student is creating the gamesOutput list on lines 5 and 26.
The second is located in the printResults function on line 37. The student is only selecting index 0 in the gamesOutput list. It should be gamesOutput[i]. Correcting both errors should get the data showing in the simulator. Please let us know if you need additional assistance.

Terence,
Thank you for the insight. Changing the index to i vs 0 makes sense to me and I will pass that along. Unfortunately, if taken out of line 5 and left as a local variable, the gamesOutput is not recognized. If left in line 5 it still doesn’t output the requested information. I am still not certain where we went wrong yet.

I realized that the var in 37 was supposed to be called in and not another declaration of 5. I found that the / was chosen rather than , but still after making the modifications, there are no visible results. Here is the most recently modified code:

We got it to work and made some modifications to see if by doing so, it made a negative impact and it didn’t. The issue was not with the code, but the data being requested wasn’t precise; it was too general. Now it works fine and the student learned a valuable lesson as did his teacher.
Here is the newly tweaked app.

1 Like