function randomPick(a, b) { if (randomBoolean()) return a; else return b; } function Mind() { //--- public functions / interface / API ------- this.newRun = function() { }; this.endRun = function() { }; // x is an array of [ ai, aj, ei, ej ] this.getAction = function() { //console.log(slots); return (5); }; }