Struggling with the level, I can not see what is wrong… In this level, there’s some fire-traps and the goal is to add the minimum and maximum values of the fire-traps and “say” it at the cross position. I used a “while hero.time < 5” in order to have a while-loop for the fire-trap thing and then doing something else.
while hero.time < 5: trapIndex = 0 trapValm = 900 trapValp = 0 wtrap = None strap = None traps = hero.findByType("fire-trap") while trapIndex < traps : trapm = traps[trapIndex] if trapm.value < trapValm : wtrap = trapm trapValm = trapm.value trapp = traps[trapIndex] if trapp.value > trapValp : strap = trapp trapValp = trapp.value trapIndex +=1 val = strap.value + wtrap.value hero.moveXY(27, 42) hero.say(val)
I don’t know how to have the value retain.
Thanks for your help
(sorry if there’s some english mistakes, I’m French)