as it’s written in the description I start the level without changing anything in the code. But when I place a flag the hero doesn’t go to the flag. Furthermore, the hero doesn’t say anything, when I don’t place a flag. Returning to the code menu, it says “repair your code. invalid string (possibly contains a unicode character”.
How can the problem be fixed?
- Did you click “submit”, as one cannot place flags unless they are running in the submission mode.
- It’s python
- Yes, I pressed “Submit”, the scenery is running (coins are generated and I can place flags, but the hero just stands und doesn’t do anything)
I just copied the code. Please, don’t wonder that the instructions are in German
# Klicke "Senden" sobald du bereit bist die Flaggen zu platzieren. # Flaggen-Buttons erscheinen links unten nach dem Klicken auf "Senden". while True: flag = hero.findFlag() if flag: hero.pickUpFlag(flag) else: hero.say("Platziere die Flagge für mich, um mir den Weg zu weisen.")
when posting code, especially Python, you can use the “Formatted Text” button to preserve the spacing.
So I just ran the code in Python on Safari and it worked as well…
Your code looks right… And I just finished it with Python code on my side as well. (check the top 10)
Which hero/gear are you using ? Did you equip a “flag” to allow the code for
pickupFlag() to work?
I mean you can see something like the following in your “allowed code” area, right?
ü is unicode and will cause the hero.say to malfunction!
so the statement:
hero.say("Platziere die Flagge für mich, um mir den Weg zu weisen.")
is actually breaking the code.
Change it to
hero.say("Platziere die Flagge fur mich, um mir den Weg zu weisen.")
can we use “fur” instead of “für” ?
Ah yes , now it works for me, too! thank you so much!
@StephHardy Thank you for catching this.
Here is the actual code you will want:
hero.say("Platziere die Flagge f" + '\u00FC' + "r mich, um mir den Weg zu weisen.")
Sadly this doesn’t look nice in the code though…
Somebody forgot about the special characters in the German language
It’s good to see an exampel to insert special characters.
Не воспринимает русские буквы
also fails due to unicode issues. So I would guess that any non ASCII ? characters would be causing issues? @nick Is this a new bug? Or has unicode never worked in the hero.say() routine?
It’s probably the new Python parser. I’ll see what we can do.