first of all, is it hard to create??because i am just a newbie here.

or can you guys just tell me the algo/logic needed to construct that ai.because i want to learn creating my own script..

thanks in advance..