// =================================================================================================
// Sample Mind for more complex starter WWM World
// =================================================================================================
// World tells us agent position and enemy position
// World does not tell us of existence of walls
// if return invalid move (not empty square) World just ignores it and we miss a turn
function randomPick ( a, b )
{
if ( randomBoolean() )
return a;
else
return b;
}
function Mind() {
//--- public functions / interface / API ----------------------------------------------------------
var stepCount = 20;
this.newRun = function()
{
};
this.endRun = function()
{
};
this.getAction = function ( x ) // x is an array of [ ai, aj]
{
if(stepCount == 0)
{
stepCount = randomintAtoB(10, 40);
return (ACTION_SCAN);
}
else if(stepCount == 1)
{
stepCount--;
return ACTION_REVEAL;
}
else
{
stepCount--;
return ( randomintAtoB (0,4) );
}
};
}