Code viewer for Mind: Test Mind

// Cloned by Lazarus on 7 Nov 2018 from Mind "Cloned New Mind" by Lazarus 
// Please leave this clone trail here.
 


// Cloned by Lazarus on 6 Nov 2018 from Mind "New Mind" by Lazarus 
// Please leave this clone trail here.
 
 
function Mind() 
{ 
	
	this.newRun = function()                  
	{
	};


	this.getAction = function ( state )		 
	{ 
	  var ai = state[0];
	  var aj = state[1];
	  var ei = state[2];
	  var ej = state[3]
	  
	  if (ei < ai) {
	      return ACTION_RIGHT, AB.randomPick(ACTION_RIGHT, ACTION_UP, ACTION_DOWN), AB.randomIntAtoB(0,4);
	  }
	  if (ei > ai){
	      return ACTION_LEFT, AB.randomPick(ACTION_LEFT, ACTION_UP, ACTION_DOWN), AB.randomIntAtoB(0,4);
	  }
	  
	  if (ej < aj) {
	      return ACTION_UP, AB.randomPick(ACTION_UP, ACTION_LEFT, ACTION_RIGHT), AB.randomIntAtoB(0,4);
	  }
	  if (ej > aj) {
	      return ACTION_DOWN, AB.randomPick(ACTION_DOWN, ACTION_LEFT, ACTION_RIGHT), AB.randomIntAtoB(0,4);
	  }
	  
	  
	};

		 
	this.endRun = function()                 
	{
	};

}