Batteleship V

how to find the x coordinate of rock in this program

batteleship v