Code viewer for Mind:
Dab
// Cloned by Mikey Dowling on 5 Nov 2018 from Mind "New Mind" by Mikey Dowling
// Please leave this clone trail here.
function Mind()
{
this.newRun = function()
{
};
//0 left, 1 right, 2 up, 3 down
this.getAction = function ( state ){
if ( state.stuckfor > 1 ) return ( AB.randomIntAtoB (0,3) );
//var distance1 = abs((state[0] - state[2]));
//var distance2 = abs((state[1] - state[3]));
if (AB.randomBoolean()){
if (state[0] > state[2]){return 1}
if (state[1]>state[3]) {return 2}
}
else {
if (state[0] < state[2]){return 0}
if (state[1]< state[3]) {return 3}
}
return (AB.randomIntAtoB(0,3));
};
this.endRun = function()
{
};
}