// =================================================================================================// Sample Mind for P5 plain World // =================================================================================================// no need to pass state as argument // since the info we need are global variables anyway
AB.mind.getAction =function(){// move object towards target if( AB.randomBoolean())// randomly choose to track target x or y each step {if( x < tx )return ACTION_RIGHT;elsereturn ACTION_LEFT;}else{if( y < ty )return ACTION_DOWN;elsereturn ACTION_UP;}};