Code viewer for Mind: New Mind
class Player {
    constructor()
    {
        var pos_x = 0;
        var pos_y = 0;
    }
}


class Map {
   constructor() 
   {
       var map_val = [];
       for (var i = 0; i < 20; i++)
       {
           map_val[i] = [];
           for (var j = 0; j < 20; j++)
           {
             if (i === 0 || i == 19 || j === 0 || j == 19)
              map_val[i][j] = 1;
             else
              map_val[i][j] = -1;
           }
       }
   }
}
 
function Mind() 
{ 
	var player;
	var ennemy;
	var map_S;
	
	this.newRun = function()                  
	{
	    player = new Player();
	    ennemy = new Player();
	    map_S = new Map();
	    map_S.initmap();
	    
	    console.log(map_S.map_val);
	    map_S.map_val[0][0] = 0;
	};


	this.getAction = function ( state )		 
	{ 
	 player.pos_x = state[0];
	 player.pos_y = state[1];
	 ennemy.pos_x = state[2];
	 ennemy.pos_y = state[3];

     console.log("player = " + player.pos_x + " , " + player.pos_y);
	 
     //map.map[player.pos_y][player.pos_x] = 0;
     //map.map[ennemy.pos_y][ennemy.pos_x] = 0;

     console.log(ennemy.pos_x);
	
	  return (ACTION_UP);	
	};

		 
	this.endRun = function()                 
	{
	};

}