[SOLVED] Please help me with reindeer wakeup

but i still need help @dedreous

Here put

statusIndex

Does it work now? (PS I am currently brushing my teeth)

he’s only saying one thing. here’s my code:

# This array contains the status for each reindeer.
deerStatus = [ 'asleep', 'asleep', 'asleep', 'asleep', 'asleep' ]

# And this array contains our reindeer.
friends = hero.findFriends()

# Loop through the reindeer and find the awake ones:
for deerIndex in range(len(friends)):
    reindeer = friends[deerIndex]
    # Reindeer with y position > 30 aren't in a pen.
    # If so, set the reindeer's entry to "awake".
    if reindeer.pos.y > 30:
        deerStatus = ["awake"]
    pass

# Loop through statuses and report to Merek.
for statusIndex in range(len(deerStatus)):
    # Tell Merek the reindeer index and its status.
    # Say something like "Reindeer 2 is asleep".
    hero.say("Reindeer" + " " + statusIndex + " " + "is" + " " + deerStatus[statusIndex])
    pass

i realised that “awake” wasn’t an array :rofl:

With this change the deerIndex element of the deerStatus array to “awake”.
Does it work now?

what do you mean? (20 chars)

Instead of that put

deerStatus[deerIndex] = "awake"

Remember that statusIndex is just a pointer…in this case a pointer to deerStatus. It is used to indicate which element (index) of the array you are examining at the moment.

thanks @AnSeDra for help, and thanks @dedreous for that advice / comment. i beat the level :partying_face:

You also need to make a similar change to this line:

deerStatus = ["awake"]

Except, the brackets do not go around the string.

No problem! And congratulationsfor completing the level! :partying_face:
Have to go to bed now. Bye!

bye @AnSeDra! :partying_face: