In the level Toil and Trouble, the goal is to make a targeting function that will return a specific enemy based on the type of friend submitted to the function. I attempted three strategies, some of which have the opposite outcome from which should be expected.
- Strategy 1: all soldiers attack witch nearest to me, archers attack enemy nearest to them. Desired outcome: Success (failure acceptable) Actual outcome: Failure, most soldiers die before even reaching the witches
- Strategy 2: all friends attack enemy nearest to them. Desired outcome: Failure. Actual Outcome: Success, about four friends remaining
- Strategy 3: all soldiers attack witch nearest to them, archers attack any unit nearest to them. Desired outcome: Success Actual outcome: Success, about three friends remaining
I am mostly concerned with the success of Strategy 2. It seems contrary to the goals of the level, in that it does not require the player to use functions in the desired manner.