function randomPick ( a, b ) { if ( randomBoolean() ) return a; else return b; } function Mind() { //--- public functions / interface / API ---------------------------------------------------------- this.newRun = function() { }; this.endRun = function() { }; this.getAction = function ( ) // playerPos is an array of [playerX, playerZ] { }; }