Tracking targets between turns

In the tutorial level is there any way to distinguish each individual enemy even if they have the same name.

What I am trying to do is store the distance of each enemy on 2 different turns and then for each enemy compare the two distances in order to calculate the speed to that I can select the one which will reach me soonest.

Obviously to do this I need to uniquely identify each enemy.
Even if I assume that all enemies of the same type have the same speed and only checked the speed of one of each type I would still need some way of knowing that the one whos distance I store is the same between turns.

from what I can tell the game does not give you the list of targets in any particular order. correct me if i am wrong about this as this may be a way to distinguish them.

You don’t need to calculate the speed. The game can be solved by the pseudo code given in the statement, below the viewer.

Keep Coding :slight_smile:

PS: Also, there are no validator tests with enemies that have the same name. This means if you pass all the tests except the first you can still score 100%.

PPS: We’re changing the rules of the onboarding later today, we aim to make it simpler to avoid frequent confusions.

1 Like