- Joined
- Oct 12, 2011
- Messages
- 3,449
Illustration:
Hint:
Problem:
Quest:
Disclaimer:

Hint:
It's some kind of circular array. Actually it's just normal array but we will return to the first index (1) when reaches max size (12).
Problem:
Imagine there are 2 nodes in the list. The first node is static (non-moving), we call it "target". While the other one is dynamic, we call it "missile". The "missile" will be moved towards the "target" (moved to the next or previous node) periodically. However, it must have the shortest path as possible. Example:
1. If the "missile" starts at index-3 and the "target" is at index-8, the "missile" will be moved to the next node on every tick.
2. If the "missile" starts at index-8 and the "target" is at index-3, the "missile" will be moved to the previous node on every tick.
However,
3. If the "missile" starts at index-11 and the "target" is at index-3, the "missile" will be moved to the next node on every tick.
Halt if "missile" and "target" have a same index.2. If the "missile" starts at index-8 and the "target" is at index-3, the "missile" will be moved to the previous node on every tick.
However,
3. If the "missile" starts at index-11 and the "target" is at index-3, the "missile" will be moved to the next node on every tick.
Quest:
Create an algorithm to solve the problem perfectly with the best efficiency as possible. Good luck.
(Note: you can write the code in JASS.)
(Note: you can write the code in JASS.)
Disclaimer:
I haven't successfully solved this as well. This is not a challenge, it's more like I'm asking for help here.