Last line in the Library Tactician Level code

Could someone explain why commandArcher() can’t have the same arguments as commandSoldier() like I coded in the last line of the Library Tactician code?

    # Create a variable containing your archers.
        archers = hero.findByType("archer")
    for i in range(len(soldiers)):
        soldier = soldiers[i]
        commandSoldier(soldier, i, len(soldiers));
    # use commandArcher() to command your archers
            archers = hero.findByType("archer")
    for i in range(len(archers)):
        archer = archers[i]
        commandArcher(archer, i, len(archers));

It’s probably because you didn’t give the function extra things to define (the index and the length of the array). The function for the archers also doesn’t need to define that since you just need to specify the which archer is being told the instructions archer and tell it what target to shoot at. The soldiers on the other hand need to have the index and the length of the array “soldiers” (and therefore the number of soldiers) to complete the math used in the function and form the circle.
Hope I explained well lol :sweat_smile: (a bit late too)

1 Like

Welcome to the forum @WateryFlaminguy ! :partying_face: This is a friendly place where you can ask help on levels, report bugs, or just chat with other coders! Don’t forget to read the guidelines if you haven’t yet. I’m sure you will be an amazing addition to the forum. Have a great time!

Just want to make something clear, it is really nice of you to help people on here, and your suggestions are amazing, but it’s better to avoid reviving dead topics, because some of the users are inactive and might not see your post. not talking about this topic, but this one, and this