Also, when I click the “help” button, the pop up window stays blank, so i’m not sure if its a glitch.(@nick) edit: i finally passed but probably not the right way. Here is a look at my code if anybody needed help. Not the most efficient but it works.
Looks like we haven’t written a guide yet for that level, which is why it’s blank; hope to get that filled in soon.
I wasn’t easily able to reproduce the infinite loop problem, but what happens if you change your x thresholds lower and lower, like 34, 33, 32 instead of 35–does it eventually get you there?
When I use the code you provided, I don’t get “hard limit”, I get the slow-infinite code error.
If I close and reopen the level, I get stuck in different places, sometimes I can get passed the 2nd redX sometimes I don’t even make it to the first gem…???..
Personally, I am inclined to blame the “move” command since it is not blocking, the code runs ahead.
Quasi-side note: We need to change the default code . . . as we are teaching a bad thing…
Honestly, I should have complained about this ages ago, but I didn’t care back then…
while x<35:
gem1 = gems[1]
move to gem1
Why are we teaching people to set gem# (which won’t change) inside the while loop??
Move these outside the while-loops and I stop getting the error. (yes, it is pseudo code)
gem1 = gems[1]
while x<35:
move to gem1
If the “slow/inf code error” is codecount-time based then it makes sense, since it removes lines of code from the count and would also effect “hard limit”.
Did something change? 'cause it shouldn’t hit either limit with the expected solution…
Moving the gem assignment outside the while loop makes the code more efficient, but it is not the main error cause
while x<35
move to gem1
If you set gem1 to the wrong value (if gem1.x < 35) then your hero will never move past x=35 and your code will loop forever (or until hard execution limit is reached :))
It’s nice that you’re trying to help these people, but they were posting about this topic 5 years ago. Please could you check the date on a topic, and only reply to recent posts.
I agree with Jenny, and could you remove the correct code so others won’t try and cheat? This is a learning forum, not a place to look for answers.
Thanks,
Lydia