Code viewer for Mind: Dumb Mind
function randomPick (a,b)
{
    if (randomBoolean())
        return a;
    else
        return b;
}

function Mind()
{
    var i= -1;
    this.newRun = function()
    {
        
    };
    //Chasing lights, if row above i is lit, flip the light, else move on.
    //naive solution, lowest number of lights on was 2.
    this.getAction = function (BINARY)
    {
   
        i++;
        if(i > 24)
           i= i%24;
            
        if(BINARY[i] == 1 && BINARY[i+5] == 1 && i < 20)
            return i+5;
        else if(BINARY[i] == 1)
           return i+1;
        else if(BINARY[i] === 0)
            return 0;
                 
               
        
    };
    this.endRun = function()
    {
        
    };
}