cheks is x,y koord have x+1 ,y+1,y-1 or x-1 koords or not. Works at array. (0,0)-left upper corner. (Xmax,Ymax)- right bottom corner