// Cloned by Adaam on 6 Nov 2018 from Mind "New Mind" by Adaam
// Please leave this clone trail here.
function Mind()
{
this.newRun = function()
{
};
this.getAction = function ( state )
{
};
this.endRun = function()
{
};
}
function Mind()
{
this.getAction = function ( x )
{
var ai = x[0];
var aj = x[1];
var ei = x[2];
var ej = x[3];
if (ai<ei && aj<ej) return (AB.randomPick(ACTION_LEFT, ACTION_DOWN));
if (ai<ei && aj>ej) return (AB.randomPick(ACTION_LEFT, ACTION_UP));
if (ai>ei && aj<ej) return (AB.randomPick(ACTION_RIGHT, ACTION_DOWN));
if (ai>ei && aj>ej) return (AB.randomPick(ACTION_RIGHT, ACTION_UP));
if (ai===ei && aj<ej) return (AB.randomPick(ACTION_DOWN, AB.randomPick(ACTION_LEFT, ACTION_RIGHT)));
if (ai===ei && aj>ej) return (AB.randomPick(ACTION_UP, AB.randomPick(ACTION_LEFT, ACTION_RIGHT)));
if (ai<ei && aj===ej) return (AB.randomPick(ACTION_LEFT, AB.randomPick(ACTION_UP, ACTION_DOWN)));
if (ai>ei && aj===ej) return (AB.randomPick(ACTION_RIGHT, AB.randomPick(ACTION_UP, ACTION_DOWN)));
if (ai===1 && aj===1) return (AB.randomPick(ACTION_RIGHT, ACTION_DOWN));
if (ai===1 && aj===18) return (AB.randomPick(ACTION_RIGHT, ACTION_UP));
if (ai===18 && aj===1) return (AB.randomPick(ACTION_LEFT, ACTION_DOWN));
if (ai===18 && aj===18) return (AB.randomPick(ACTION_LEFT, ACTION_UP));
return (AB.randomIntAtoB(0,4));
};
}