Add a ping command which accepts a grid location and returns an indication as to whether or not something returned an echo in that location, ie, only a ship, bombed or not, should return an echo.
That is what I need to do, but I don't know what a ping command is.
In that context, ping is probably some boolean function that returns true if the grid is occupied and false otherwise. Assuming you're doing this for a Battleship-style game, ping is naval a term used to describe active sonar. The name Ping is arbitrary and is just named that way to reflect the imaginary "Battleship" domain in which you're working.