function inArray(x, y, array){ return x >= 0 && x < array[0].length && y >= 0 && y < array.length; }