//game is user controlled, mind allows user to move function Mind() { //--- public functions / interface / API ---------------------------------------------------------- this.newRun = function() { }; this.endRun = function() { }; this.getAction = function ( x ) // x is an array of [ ai, aj, ei, ej ] { var ai = x[0]; var aj = x[1]; var ei = x[2]; var ej = x[3]; }; }